Created
June 9, 2017 05:22
-
-
Save nisrulz/d1c3367eb3b98763c1fcd9fc82850c38 to your computer and use it in GitHub Desktop.
Read and load a csv file into pandas data frame
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
import pandas as pd | |
import csv | |
with open("<filename>.csv", 'r') as f: | |
with open("updated_file.csv", 'w') as f1: | |
f.next() # skip header line | |
f.next() # skip header empty line | |
for line in f: | |
f1.write(line.replace('\x00', '')) | |
df = pd.read_csv('updated_file.csv') | |
print df |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment