File Handling Demo - Jupyter Notebook
File Handling Demo - Jupyter Notebook
1 of 4 22-03-2024, 12:17
File handling demo - Jupyter Notebook http://localhost:8888/notebooks/Archana%20Python/Python/File%20ha...
In [3]: df = pd.DataFrame(data=data).T
df
Out[3]: COUNTRY POP AREA GDP CONT IND_DAY
You can save your pandas DataFrame as a CSV file with .to_csv()
In [6]: df to_csv('data.csv')
2 of 4 22-03-2024, 12:17
File handling demo - Jupyter Notebook http://localhost:8888/notebooks/Archana%20Python/Python/File%20ha...
In [10]: df to_excel('data.xlsx')
3 of 4 22-03-2024, 12:17
File handling demo - Jupyter Notebook http://localhost:8888/notebooks/Archana%20Python/Python/File%20ha...
In [ ]:
4 of 4 22-03-2024, 12:17