Complete the code to select the first row of the DataFrame using .iloc.
first_row = df.[1][0]
The iloc method selects rows by integer position. Here, df.iloc[0] gets the first row.
Complete the code to set the 'id' column as the DataFrame index.
df = df.[1]('id')
The set_index method sets a column as the DataFrame index.
Fix the error in the code to select rows where the index is greater than 5.
filtered = df[df.index [1] 5]
To filter rows with index greater than 5, use the '>' operator.
Fill both blanks to create a dictionary of word lengths for words longer than 3 characters.
lengths = {word: [1] for word in words if len(word) [2] 3}The dictionary comprehension maps each word to its length if the word length is greater than 3.
Fill all three blanks to create a dictionary of uppercase keys and values greater than zero.
result = [1]: [2] for k, v in data.items() if v [3] 0}
This dictionary comprehension creates keys as uppercase strings and includes only items with values greater than zero.