CBSE Class 12 Informatics Practices Question 29 of 44

Data Handling using Pandas — Question 30

Back to all questions
30
Question

Question 27

By default, read_csv() uses the value 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?

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).