title: How to save array to csv file without converting it to a string?
body: <p>I have an array that looks like this:</p>
  
  <pre><code>data_struct = [[0,'YES',0.25,[[[234], [432], ..., [523]]]], 
                 [0,'YES',0.25,[[[234], [432], ..., [523]]]]]
  </code></pre>
  
  <p>I want to save to it to a csv file so that I can use the data as is for later.</p>
  
  <p>I am currently trying this:</p>
  
  <pre><code>with open(r'data.csv', 'a') as f:
      writer = csv.writer(f)
      writer.writerow(data_struct[0])
  </code></pre>
  
  <p>Which works fine, but the problem is that the fourth element in each row ( the large arrays) turn into a string so it becomes :</p>
  
  <pre class="lang-none prettyprint-override"><code>"[[[234],\n[432],\n ..., [523]]]]"
  </code></pre>
  
  <p>I want to load the csv file later and have the data in the same format.</p>
  
  <p>How do I go about solving this problem?</p>