title: Pandas calculate average number of words in groupby
body: <p>Lets say I have a dataframe that looks like this:</p>
  
  <pre><code>df = pd.DataFrame({'id': [1,1,1,1,2,2,2,3,4,4,4,4,4],
                     'feedback': ['one word', np.nan, np.nan, 'test',
                                  'second', np.nan, 'test 2',
                                  np.nan,
                                  'fourth', 'multiple words', 'test 1 2 3', 'things', np.nan]})
  
  print(df)
  
      id        feedback
  0    1        one word
  1    1             NaN
  2    1             NaN
  3    1            test
  4    2          second
  5    2             NaN
  6    2          test 2
  7    3             NaN
  8    4          fourth
  9    4  multiple words
  10   4      test 1 2 3
  11   4          things
  12   4             NaN
  </code></pre>
  
  <p>I want to calculate some aggregated values: </p>
  
  <ul>
  <li>row count for each <code>id</code> </li>
  <li>number of rows where feedback was provided for each <code>id</code></li>
  <li>average number of words of provided feedback for each
  <code>id</code></li>
  </ul>
  
  <p>My desired output is:</p>
  
  <pre><code>   id  count  complete  avg_words
  0   1      4         2        1.5
  1   2      3         2        1.5
  2   3      1         0        NaN
  3   4      5         4        2.0
  </code></pre>
  
  <p>I have the following code which accomplishes all but the final point:</p>
  
  <pre><code>df.groupby(['id']).agg({'id': 'count',
                          'feedback': ['count', lambda x: len(x)]}).reset_index()
  </code></pre>
  
  <p>Which gives me:</p>
  
  <pre><code>  id       feedback         
       count    count &lt;lambda&gt;
  0  1     4        2        4
  1  2     3        2        3
  2  3     1        0        1
  3  4     5        4        5
  </code></pre>
  
  <p>Everything is correct apart from the final column (the indexing is also a bit strange, but thats a minor issue)</p>
  
  <p>The lambda function is a placeholder. How do I calculate the average number of words of only the provided feedback for each <code>id</code>?</p>