Complete the code to select the column 'Age' from the DataFrame df.
age_column = df[[1]]To select a column by name in pandas, you use the column name as a string inside square brackets.
Complete the code to select multiple columns 'Name' and 'Salary' from the DataFrame df.
selected_columns = df[[1]]To select multiple columns, pass a list of column names inside the brackets.
Fix the error in the code to select the 'City' column from df.
city = df.[1]When using dot notation to select a column, use the exact column name without quotes.
Fill both blanks to select columns 'Height' and 'Weight' from df and assign to new_df.
new_df = df[[1]] print(new_df.columns[[2]])
Use a list of column names to select multiple columns. Index 0 accesses the first column name.
Fill all three blanks to create a dictionary with column names as keys and their data types as values.
col_types = [1]: df[[2]].dtype for [3] in df.columns}
Use a dictionary comprehension with a variable iterating over df.columns. The variable is used as key and to select the column.