Complete the code to check for duplicate rows in the DataFrame.
duplicates = df.[1]()The duplicated() method returns a boolean Series showing which rows are duplicates.
Complete the code to count how many duplicate rows exist in the DataFrame.
num_duplicates = df.duplicated().[1]()Summing the boolean Series counts how many True values (duplicates) there are.
Fix the error in the code to remove duplicate rows from the DataFrame.
df_clean = df.[1](keep='first')
The drop_duplicates() method removes duplicate rows, keeping the first occurrence.
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 with 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 versions of k and includes only items where the value v is greater than zero.