Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

export file csv python

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
''';

Comment

PREVIOUS NEXT
Code Example
Python :: export dataframe csv python 
Python :: how to find ip address of website using python 
Python :: selenium refresh page python 
Python :: python listdir with full paths 
Python :: install matplotlib.pyplot mac python 3 
Python :: read .dat python 
Python :: download pdf from link using python 
Python :: python random hex color 
Python :: python calculate time taken 
Python :: timeout exception in selenium python 
Python :: jalali date to gregorian date 
Python :: open pkl file python 
Python :: flask gmail config 
Python :: how to get size of folder python 
Python :: python find dict in list of dict by id 
Python :: How to increase text size tkinter 
Python :: how to install drivers for selenium python 
Python :: alias python in macbook 
Python :: python pie chart 
Python :: python youtube downloader mp3 
Python :: python choose random element from list 
Python :: python: change column name 
Python :: python how to read a xlsx file 
Python :: how to find the most frequent value in a column in pandas dataframe 
Python :: normalize values between 0 and 1 python 
Python :: convert mp3 to wav python 
Python :: how to save matplotlib figure to png 
Python :: conda python 3.8 
Python :: read file line by line into list 
Python :: python how to find the highest number in a dictionary 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =