Export File Csv Python

[Solved] Export File Csv Python | Vb - Code Explorer | yomemimo.com
Question : export file csv python

Answered by : gabriel-juri

import pandas as pd
# Dataframe example
df = pd.DataFrame({'col_A':[1,5,7,8],'col_B':[9,7,4,3]})
# Save dataframe as csv file in the current folder
df.to_csv('filename.csv', index = False, encoding='utf-8') # False: not include index
print(df)
#Note: to Save dataframe as csv file in other folder use instead:
'''
df.to_csv('Path/filename.csv', index = False, encoding='utf-8') # Replace 'Path' by the wanted folder
''';

Source : https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_csv.html | Last Update : Thu, 05 May 22

Answers related to export file csv python

Code Explorer Popular Question For Vb