Pre-recorded question

Question #366
How to save a DataFrame in a csv file in Python?
Answer

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)


4 events in history
Answer by Alphonsio 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 Alphonsio 11/19/2020 at 06:48:14 PM
How to save a DataFrame in a csv file in Python?
Answer by Alphonsio 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 Alphonsio 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.