CBSE Class 12 Informatics Practices Question 3 of 70

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

Back to all questions
3
Question

Question 3

Assertion. The read_csv() function reads a csv file's data into a DataFrame.

Reason. The to_csv() function writes a DataFrame on to a csv file.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.
Answer

Both A and R are true but R is not the correct explanation of A.

Explanation
The read_csv() function in Pandas is used to read data from a CSV file into a DataFrame. Conversely, the to_csv() function is used to write DataFrame data to a CSV file.