title: Generating a dataframe from a groupby transformation
body: <p>I have this code:</p>
  <pre><code>df.droupby('type)['feature1].mean()
  </code></pre>
  <p><code>df</code> has 15 <code>features</code> from <code>1 to 15</code></p>
  <p>I want to iterate over a list of the features names and append these 15 results in a dataframe:</p>
  <p><strong>Desired Output: type(dataframe)</strong></p>
  <pre><code>    type      feature1       features2  ..... feature15
      type_A    mean(float)    mean(float)      mean(float)
      type_B    mean(float)    mean(float)      mean(float)
      type_c    mean(float)    mean(float)      mean(float)
  </code></pre>
  <p><strong>What I did:</strong></p>
  <p>I have the list of features:</p>
  <pre><code>list = df.iloc[:, 10:24].columns.to_list()
  </code></pre>
  <p>and tried something like this:</p>
  <pre><code>for i in len(list):
      df.groupby('type')[list[i]].mean()
  </code></pre>
  <p>to see if I get something and this line returns an error:</p>
  <pre><code>'int' object is not iterable
  </code></pre>
  <p>Can anyone help me with this?</p>