Skip to main contentSkip to solution

Which of the following statements are TRUE with respect to data handling uisng Pandas?

(A) A Series is a one-dimensional array containing a sequence of values.

(B) DF = DF.drop(['Samridhi','Ramit','Riya'], axis=1) will delete the columns having labels 'Samridhi', 'Ramit' and 'Riya'.

(C) DataFrame.loc[ ] is used for label based indexing of rows in DataFrames.

(D) Pandas.DataFrame.append() method is used to merge two DataFrames.

Solution

✅ Correct Option: 3

All four statements are true.

(A) A Series is a one-dimensional labelled array that holds a sequence of values.

(B) In drop(), axis=1 means columns, so the call removes the columns labelled 'Samridhi', 'Ramit' and 'Riya'. Assigning the result back to DF keeps the change.

(C) DataFrame.loc[ ] selects rows (and columns) by label, while iloc[ ] uses integer position.

(D) DataFrame.append() joins the rows of one DataFrame to another, which is how the syllabus describes merging two DataFrames.


Statement (D) can look false because append() was deprecated and later removed in newer pandas versions (pd.concat() replaces it). The syllabus still treats it as a valid method, so (D) is counted as true.

Keyboard Shortcuts

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