title: Add column with number of ratings per user, pandas
body: <p>I am working with a book rating dataset of the form</p>
  
  <pre><code>userID | ISBN | Rating
  23413    1232     2.5
  12321    2311     3.2
  23413    2532     1.7
  23413    7853     3.8
  </code></pre>
  
  <p>Now I need to add a fourth column that contains the number of ratings each user has in the entire dataset:</p>
  
  <pre><code>userID | ISBN | Rating | Ratings_per_user
  23413    1232     2.5         3
  12321    2311     3.2         1
  23413    2532     1.7         3 
  23413    7853     3.8         3
  </code></pre>
  
  <p>I have tried: </p>
  
  <pre><code>df_new['Ratings_per_user'] = df_new['userID'].value_counts()
  </code></pre>
  
  <p>but I get an error: </p>
  
  <pre><code>A value is trying to be set on a copy of a slice from a DataFrame.
  Try using .loc[row_indexer,col_indexer] = value instead
  </code></pre>
  
  <p>and the entire new column is filled with <code>NaN</code>. </p>