0

I have several numpy arrays of different sizes and want to store them in a single csv file. When i try and do it using the following code

df = pd.DataFrame.from_dict({"Title" : titles_ht, "Authorname" : authorname_ht, "Article" : article_ht, "Summary" : shortsummary_ht, "Tags" : tags_ht})
df.to_csv("HT.csv", index=False) 

i get an error saying that the arrays are of uneven size.

How do i create a csv file with each of these uneven arrays.

anky
  • 74,114
  • 11
  • 41
  • 70
  • A properly formatted cav has rows with equal numbers of columns. How your arrays supposed to produce that? – hpaulj Mar 06 '19 at 09:54

1 Answers1

0

You can use the numpy.savetxt() function to export it as a csv file.

Tutorial here

Jessica Chambers
  • 1,246
  • 5
  • 28
  • 56