Skip to main contentSkip to solution

If data needs to be imported in a DataFrame from a csv file where values are separated via space, then which of the following syntax would be correct?

Solution

✅ Correct Option: 2

The sep parameter of pd.read_csv() tells pandas which character separates the values in each row. For a space-separated file, sep = ' ' splits each line at the spaces into columns. NCERT uses sep for this, so NTA's key follows the textbook.


Option 1: index is not a read_csv parameter. The row labels are chosen with index_col.

Option 4: header takes the row number to use as column names (such as 0 or None), not a separator.


We believe the answer could be Option 3, since delimiter is an alias for sep in pd.read_csv and works identically. However, NTA's final answer key (after all challenges) says Option 2.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question