Computer Science · Python Pandas
Which of the following are the correct Pandas syntaxes to delete a column from a DataFrame named 'df1'? (A) df1 = df1.drop('column_name', axis=1) (B) df1.drop('column_name', axis=1, inplace=True) (C) df1.drop('column_name', axis='columns', inplace=True) (D) df1.drop(columns=['column_name'], inplace=True)
- 1(A), (B), (C) and (D)✓
- 2(A), (B) and (C) only
- 3(B) and (C) only
- 4(A) and (B) only
Correct answer
(A), (B), (C) and (D)
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on Python Pandas?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · Python Pandas