title: Pandas DataFrame stored list as string: How to convert back to list
body: <p>I have an <em>n</em>-by-<em>m</em> Pandas DataFrame <code>df</code> defined as follows. (I know this is not the best way to do it. It makes sense for what I'm trying to do in my actual code, but that would be TMI for this post so just take my word that this approach works in my particular scenario.)</p>
  
  <pre><code>&gt;&gt;&gt; df = DataFrame(columns=['col1'])
  &gt;&gt;&gt; df.append(Series([None]), ignore_index=True)
  &gt;&gt;&gt; df
  Empty DataFrame
  Columns: [col1]
  Index: []
  </code></pre>
  
  <p>I stored lists in the cells of this DataFrame as follows.</p>
  
  <pre><code>&gt;&gt;&gt; df['column1'][0] = [1.23, 2.34]
  &gt;&gt;&gt; df
       col1
  0  [1, 2]
  </code></pre>
  
  <p>For some reason, the DataFrame stored this list as a string instead of a list.</p>
  
  <pre><code>&gt;&gt;&gt; df['column1'][0]
  '[1.23, 2.34]'
  </code></pre>
  
  <p>I have 2 questions for you.</p>
  
  <ol>
  <li><strong>Why does the DataFrame store a list as a string and is there a way around this behavior?</strong></li>
  <li><strong>If not, then is there a Pythonic way to convert this string into a list?</strong></li>
  </ol>
  
  <hr>
  
  <p><strong>Update</strong></p>
  
  <p>The DataFrame I was using had been saved and loaded from a CSV format. <em>This format, rather than the DataFrame itself, converted the list from a string to a literal.</em></p>