CBSE Class 12 Informatics Practices Question 6 of 44

Solved 2025 Sample Question Paper CBSE Class 12 Informatics Practices (065) — Question 6

Back to all questions
6
Question

Question 6

Which of the following Python statements can be used to select a column column_name from a DataFrame df ?

  1. df.getcolumn('column_name')
  2. df['column_name']
  3. df.select('column_name')
  4. df(column_name)
Answer

df['column_name']

Reason — The statement df['column_name'] is used to select a column named column_name from a DataFrame df in Python.