title: Using range of values in column to summarize values in another column based on condition for first column
body: <p>I cannot find any explanation about numpy.where function.</p>
  <p>I have dataframe:</p>
  <pre><code>     activity     count    
  0       1           25   
  1       2           38   
  2       3           49   
  3       4           55                       
  4       5           61   
  5       6           74   
  6       7           82  
  7       8           98   
  8       9           103   
  9       10          4084    
  </code></pre>
  <p>and I want to count values:</p>
  <ol>
  <li>for rows where activity &lt; 6, sum count (so for index &lt; 5)</li>
  <li>for rows where activity =&lt; 6, sum count ( so for index =&lt; 5)</li>
  </ol>
  <p>and crate a charts for this two condition which shows sum count values.
  I have tried:</p>
  <pre class="lang-py prettyprint-override"><code>under_total = df[df.activity &lt; 6]
  under_total.loc['under_total'] = under_total.sum(axis = 0)
  
  </code></pre>
  <p>OR</p>
  <pre class="lang-py prettyprint-override"><code>df['below_expectations'] = np.where(df['actibity'] &lt; 6, df['activity'], df['hoursActive'])
  </code></pre>
  <p>But it seems I dont get it somewhere.</p>