Home > OS >  How to export list as CSV
How to export list as CSV

Time:04-14

I have created a dataset that consists of 574 Rows and 85 Columns. The data type is a list. I want to export this data to CSV as I want to perform some analysis. I tried converting List to Dataframe using dataFrame <- as.data.frame(Data) command. I also looked out for other commands but was not able to convert the list to dataframe, or any other format. My goal is to export the data to a CSV file.

This image is a preview of the dataset:

enter image description here

This image shows that data type is list of dimension 574*85:

enter image description here

CodePudding user response:

You can try this "write.csv" function on your list.

write.csv(list,"a.csv")

it will automatically save in your working directory.

CodePudding user response:

Provide a list format of yours. I'm not sure below answer is useful for you or not.

If your list is as below

all_data_list = [[1,2,3],[1,4,5],[1,5,6],...]

you have to do:

df = pd.DataFrame(all_data_list)
  • Related