Reputation: 337
When I use Python for data analysis I want to open a csv
file in IPython
. When I use this statement:
In [92]: open('ch06/ex1.csv').read()
Out[92]: 'something,a,b,c,d,message\none,1,2,3,4,NA\ntwo,5,6,,8,world\nthree,9,10,11,12,foo'
I directly open the file. How do I open the file as a table?
Upvotes: 0
Views: 1176
Reputation: 797
I'm not sure what you are asking but if you're into data analysis you should learn pandas:
import pandas as pd
myFile = pd.read_csv('ch06/ex1.csv')
myFile.head()
Upvotes: 1