Forked from sagarnanduunc/Making to_csv and read_csv consistent for pandas
Last active
May 24, 2018 20:11
-
-
Save kaddynator/f6ff272450754fb07063eca8136f8a02 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This works in MACs | |
# Dataframe can also be used in R | |
import pandas as pd | |
##reading a csv file | |
df = pd.read_csv("PATH WHERE YOUR FILE IS SAVED/filename.csv", encoding='utf-8',lineterminator = '\n',index_col=0) | |
##writing a csv file | |
df.to_csv("PATH WHERE YOU WANT TO SAVE YOUR FILE/filename.csv",quoting=csv.QUOTE_NONNUMERIC, date_format='%Y-%m-%d %H:%M:%S', encoding='utf-8',line_terminator = '\n') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment