CBSE Class 12 Informatics Practices Question 34 of 70

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

Back to all questions
15
Question

Question 15

To suppress the creation of a column for index labels of a DataFrame, ............... argument is specified in to_sql().

  1. if_exists = False
  2. index = False
  3. index = True
  4. if_exists = True
Answer

index = False

Reason — The index = False argument in to_sql() is used to suppress the creation of a column for index labels of a DataFrame. This means that the index labels will not be included as a separate column in the database table.