CBSE Class 12 Informatics Practices Question 29 of 70

Importing/Exporting Data between CSV Files/MySQL and Pandas — Question 10

Back to all questions
10
Question

Question 10

While reading from a CSV file, to use a column's values as index labels, argument given in read_CSV() is :

  1. index
  2. index_col
  3. index_values
  4. index_label
Answer

index_col

Reason — The argument given in read_csv() to use a column's values as index labels is index_col. By specifying index_col with the name of the desired column, pandas will use the values from that column as the index labels for the DataFrame.