Skip to main contentSkip to solution

Which of the following are false about a DataFrame?

(A). It only allows homogeneous data.

(B). It does not allow missing values.

(C). It allows row and column indexing.

(D). It does not allow selection, deletion, addition, and renaming operations on rows and columns.

Solution

✅ Correct Option: 1

A pandas DataFrame is a two-dimensional labelled structure that can hold heterogeneous data, so (A) is false. It also supports missing values, stored as NaN, so (B) is false. It supports selection, deletion, addition and renaming of rows and columns, so (D) is false.

Statement (C) is true: a DataFrame has both a row index and column labels, so it allows row and column indexing. Hence only (A), (B) and (D) are false.


Option 2 and Option 3: both include (C), which is a true statement about DataFrames.

Option 4: it leaves out (A), but (A) is false because each column of a DataFrame can have a different data type.

Memory trick: a Series is 1-D and homogeneous, while a DataFrame is 2-D and can mix types across columns.

Keyboard Shortcuts

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