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] print(ages)
Use df['Age'] to select a single column as a Series.
Fix the error in the code to filter rows where Age is greater than 25.
filtered = df[df['Age'] [1] 25] print(filtered)
Use > to filter rows where Age is greater than 25.
Fill both blanks to create a dictionary comprehension that maps words to their lengths for words longer than 3 letters.
words = ['data', 'science', 'is', 'fun'] lengths = {word: [1] for word in words if [2] print(lengths)
Use len(word) to get length and filter words with length greater than 3.
Fill all three blanks to create a dictionary with uppercase keys and values filtered by value > 20.
data = {'a': 10, 'b': 25, 'c': 30}
result = { [1]: [2] for k, v in data.items() if v [3] 20 }
print(result)Keys are uppercase using k.upper(), values are v, filtered by v > 20.
