How to Export Data Frame in Jupyter as a Csv File
I Have a Data Frame Saved as Df in a Jupyter Notebook, and I Want to Export It into a Csv File on My Desktop. 1 2 Answers for a Pandas Data Frame You Can Use...
I have a data frame saved as df in a jupyter notebook, and i want to export it into a csv file on my desktop.
2 Answers
For a pandas data frame you can use df.to_csv('data.csv').
If you have data in pandas DataFrame then you can use .to_csv() function from pandas to export your data in CSV .
Here's how you can save data in desktop
df.to_csv("<path to desktop and filename>")
# If you just use file name then it will save CSV file in working directory.
# Example path : C:/Users/<>/Desktop/<file name>.csv
If you want to learn more about it you can visit official documentation.