Question:medium

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: Feb 16, 2026
  • header=False
  • index=False
  • header=True
  • index=True
Show Solution

The Correct Option is A

Solution and Explanation

Step 1: Review DataFrame.to_csv() parameters.
- `header=True` (default) writes column headers.
- `header=False` omits column headers.
- `index=True` (default) writes the DataFrame index.
- `index=False` excludes the DataFrame index.
Step 2: Apply to problem.
To avoid saving column names, set `header=False`.
Final Answer: \[\boxed{\text{header=False}}\]
Was this answer helpful?
0


Questions Asked in CUET (UG) exam