Question #364   Submitted by Answiki on 11/19/2020 at 06:07:37 PM UTC

How to save a DataFrame in a csv file?

Answer   Submitted by Answiki on 01/11/2021 at 05:26:22 PM UTC

In Python, to save dataframe into a .csv file, the best option is to use the .to_csv() method:

myDataframe.to_csv('filename.csv')

To prevent the index of each row from being stored in the file, add index=False as a second parameter:

myDataframe.to_csv('filename.csv', index=False)

5 events in history
Answer by Answiki on 01/11/2021 at 05:26:22 PM

In Python, to save dataframe into a .csv file, the best option is to use the .to_csv() method:

myDataframe.to_csv('filename.csv')

To prevent the index of each row from being stored in the file, add index=False as a second parameter:

myDataframe.to_csv('filename.csv', index=False)

Answer by Answiki on 11/19/2020 at 06:49:00 PM

In Python, to save dataframe into a .csv file, the best option is to use the .to_csv() method:

myDataframe.to_csv('filename.csv')

To prevent the index of each row from being stored in the file, add index=False as a second parameter:

myDataframe.to_csv('filename.csv', index=False)


Question by Answiki 11/19/2020 at 06:48:14 PM
How to save a DataFrame in a csv file in Python?
Answer by Answiki on 11/19/2020 at 06:47:20 PM

In Python, to save dataframe into a .csv file, the best option is to use the .to_csv() method :

myDataframe.to_csv('filename.csv')

To prevent the index of each row from being stored in the file, add index=False as a second parameter:

myDataframe.to_csv('filename.csv', index=False)


Question by Answiki 11/19/2020 at 06:07:37 PM
How to save a DataFrame in a csv file?
# ID Query URL Count

Icons proudly provided by Friconix.