title: I want to append an csv file using python pandas to add an array as new column
body: <p>I have tried the following code:</p>
  
  <pre><code>import pandas as pd
  list1 = {'Names':[1,2,3,4,5]}
  
  df = pd.DataFrame(list1)
  df_csv = pd.read_csv('try.csv')
  df_csv['Names'] = list1
  df_csv.to_csv('try.csv', index=False, mode= 'a')
  </code></pre>
  
  <p>The error is as following:</p>
  
  <pre><code>"ValueError: Length of values does not match length of index"
  </code></pre>
  
  <p>I understand that the size of the dataframe doesn't match but how can I solve that? </p>
  
  <p>So, this is what I want in try.csv file after appending:
  <a href="https://i.stack.imgur.com/ru4FS.png" rel="nofollow noreferrer">try.csv file</a></p>