Question:

While transferring the data from a DataFrame to a CSV file, if we do not want the column names to be saved to the file on disk, the parameter to be used in \texttt{to__csv()} is __________.

Show Hint

Use \texttt{header=False} to suppress column names and \texttt{index=False} to suppress row indices in CSV export.
Updated On: Sep 18, 2025
  • header=False
  • index=False
  • header=True
  • index=True
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Step 1: Recall DataFrame.to__csv().
- \texttt{header=True} (default) → writes column names to file.
- \texttt{header=False} → prevents writing column names.
- \texttt{index=True} (default) → writes index.
- \texttt{index=False} → avoids writing index.
Step 2: Match requirement.
Since the question asks to not save column names → we use \texttt{header=False}.
Final Answer: \[ \boxed{\text{header=False}} \]
Was this answer helpful?
0
0

Questions Asked in CUET exam

View More Questions