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.

1
  • A properly formatted cav has rows with equal numbers of columns. How your arrays supposed to produce that? Commented Mar 6, 2019 at 9:54

1 Answer 1

0

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

Tutorial here

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.