title: Cast column values to list keeping the order
body: <p>I have the following dataframe:</p>
  <pre><code>df1 = pd.DataFrame({'Parent': ['Stay home', &quot;Stay home&quot;,&quot;Stay home&quot;, 'Go swimming', &quot;Go swimming&quot;,&quot;Go swimming&quot;],
                     'Child': ['Severe weather', &quot;Severe weather&quot;, &quot;Severe weather&quot;, 'Not Severe weather', &quot;Not Severe weather&quot;, &quot;Not Severe weather&quot;],
                     'Child1':   [&quot;Extreme rainy&quot;, &quot;Extreme windy&quot;,   &quot;Severe snow&quot;, &quot;Sunny&quot;, &quot;some windy&quot;, &quot;No snow&quot;]
                     })
  </code></pre>
  <p>I want to cast the <code>Child1</code> column to a list groupby the <code>child</code> column</p>
  <p>So I am trying the following code:</p>
  <pre><code>def cast_to_list(df, col):
      return df.groupby('Child')[col].apply(list).tolist()
  
  list5=cast_to_list(df1, 'Child1')
  list5
  </code></pre>
  <p>Outcome:</p>
  <pre><code>[['Sunny', 'some windy', 'No snow'],
   ['Extreme rainy', 'Extreme windy', 'Severe snow']]
  </code></pre>
  <p>The expected outcome preserves the order of the values of <code>Child1</code> column:</p>
  <p>So the expected outcome is the following:</p>
  <pre><code>  [['Extreme rainy', 'Extreme windy', 'Severe snow'],
       ['Sunny', 'some windy', 'No snow']]
  </code></pre>
  <p>Any ideas?</p>