KnowledgeBoat Logo
|
LoginJOIN NOW

Informatics Practices

By default, read_csv() uses the values of first row as column headers in DataFrames. Which argument will you give to ensure that the top/first row's data is used as data and not as column headers ?

Python Pandas

4 Likes

Answer

To ensure that the top/first row's data is used as data and not as column headers in a DataFrame when using the read_csv() function, we need to use the header argument and set it to None. The syntax is : <DF> = pandas.read_csv(<filepath>, header = None).

Answered By

2 Likes


Related Questions