csv = u'''19,29,39
10,20,30,40,50
11,21,31
12,22,32,52,42
13,23,33'''
df = pd.read_csv(io.StringIO(csv), header=False, usecols=list(range(3)))
f_line = df.keys().values
df.rename(columns={k: i for i, k in enumerate(f_line)}, inplace=True)
df = pd.concat((pd.DataFrame(f_line).T, df))
df.reset_index(drop=True, inplace=True)
result:
0 1 2
0 19 29 39
1 10 20 30
2 11 21 31
3 12 22 32
4 13 23 33
Maybe this can help you for a while.
My best regards
--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.