हिंदी

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

Advertisements
Advertisements

प्रश्न

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

विकल्प

  • df.getcolumn('column_name')

  • df['column_name']

  • df.select('column_name')

  • df(column_name) 

MCQ

उत्तर

df['column_name']

Explanation:

  1. In Pandas, to access or select a specific column from a DataFrame, you use: 
  2. df['column_name']
  3. This returns the series (column) corresponding to the given column name.
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2024-2025 (March) Board Sample Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×