Complete the code to create a DataFrame from a dictionary.
import pandas as pd data = {'name': ['Alice', 'Bob'], 'age': [25, 30]} df = pd.[1](data) print(df)
Use pd.DataFrame to create a DataFrame from a dictionary.
Complete the code to select the 'age' column from the DataFrame.
ages = df[1]['age'] print(ages)
Use square brackets [] to select a column by name in pandas.
Fix the error in the code to filter rows where age is greater than 25.
filtered = df[df['age'] [1] 25] print(filtered)
Use the greater than operator > to filter ages above 25.
Complete the code to create a dictionary comprehension that maps names to ages for people older than 25.
result = {person: age for person, age in zip(df['name'], df['age']) if age [1] 25}
print(result)Use : to separate key and value in a dictionary, and > to filter ages greater than 25.
Fill all three blanks to create a DataFrame from a dictionary, select the 'score' column, and filter scores above 80.
data = {'name': ['Ann', 'Ben'], 'score': [85, 75]}
df = pd.[1](data)
high_scores = df[df[[2]] [3] 80]
print(high_scores)Create a DataFrame with pd.DataFrame, select the 'score' column with 'score', and filter with > for scores above 80.