Which parameter of the method to_csv() is used to exclude the row label to be written to the file on disk?
Which parameter of the method to_csv() is used to exclude the row label to be written to the file on disk?
Solution
✅ Correct Option: 3
In pandas, to_csv() writes the row labels (the index) as the first column by default. Setting index = False stops the index from being written to the file.
Option 1: header = False removes the column names, not the row labels.
Options 2 and 4: row and label are not parameters of to_csv().
Related questions:
2026: 18 May Shift 2
2025: 14 May Shift 1
2025: 21 May Shift 1