1

I used df = pd.read_csv('text.csv', skiprows=1) to skip the text headings in the data set. The output is similar to this:

  24424 5435 4343 
0 43533 3432 5346 
1 42243 4353 3434

However, what I want is:

0 24424 5435 4343 
1 43533 3432 5346 
2 42243 4353 3434

Because the first line currently won't print when I e.g. do this:

df2 = df.values.tolist()
print(df2)

Out:

[[43533 3432 5346], [42243 4353 3434]]

Where the first row is unfortunately skipped. Any ideas how to fix?

Note: I didn't use headers=None as suggested, otherwise I get this output:

0 colA  colB colC
1 24424 5435 4343 
2 43533 3432 5346 
3 42243 4353 3434

0 Answers0