Python pandas: read data lines (read lines)
I have a dataframe that was created by pandas, for example:
d = {'one':[1,1],'two':[2,2], 'three':[3,3]}
i = ['a','b','c']
df = pd.DataFrame(data = d, index = i)
df
one two three
a 1 2 3
b 1 2 3
c 1 2 3
Now I need to read each comma separated line, I don't want to save to_csv and then open it again, any good suggestion?
I am using something like python:
for line in df.readlines():
print line
But I don't know how to put my ideas together now, thanks a lot!
+3
source to share