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:
- In Pandas, to access or select a specific column from a DataFrame, you use:
-
df['column_name']
- This returns the series (column) corresponding to the given column name.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?