title: How can I groupby in pandas and then sum values?
body: <p>I have the next problem: I have a dataframe in pandas with an attribute 'features' and another attribute 'VOTES'. 'VOTES' is numeric, and 'features' is a string which is repeated in the dataframe. I want to group according to features and sum the values of VOTES, in order to get the next result:</p>
  
  <p>Dataframe initially:</p>
  
  <pre><code>+----------+---------+
  | features | VOTES   |
  +----------+---------+
  | A        | 4       |
  +----------+---------+
  | V        | 3       |
  +----------+---------+
  | A        | 2       |
  +----------+---------+
  | C        | 9       |
  +----------+---------+
  </code></pre>
  
  <p>I did the following but I got NaN values on VOTES column.</p>
  
  <pre><code>dataframe_clusters['VOTES'] = dataframe_clusters.groupby('features')['VOTES'].sum()
  </code></pre>
  
  <p>I want to get the next result:</p>
  
  <pre><code>+----------+---------+
  | features | VOTES   |
  +----------+---------+
  | A        | 6       |
  +----------+---------+
  | V        | 3       |
  +----------+---------+
  | C        | 9       |
  +----------+---------+
  </code></pre>