0

How to prevent the following? When I load a file with pd.read_csv(), the first line gets unwantedly treated as a header (list of column names):

import pandas as pd
data = pd.read_csv('namefile',sep=' ')
print(data)

and only the second line onwards gets treated as the data (vector = np.array(data)).

4

1 Answer 1

4

you can use the option of header to exclude columns data=pd.read_csv('namefile',sep=' ', header =None)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.