Complete the code to find duplicate rows in the DataFrame df.
duplicates = df.[1]()The duplicated() method returns a boolean Series marking duplicate rows as True.
Complete the code to find duplicate rows in df based only on the 'Name' column.
duplicates = df.duplicated(subset=[1])The subset parameter specifies columns to check for duplicates. Here, we check duplicates based on 'Name'.
Fix the error in the code to mark duplicate rows in df, keeping the first occurrence.
duplicates = df.duplicated(keep=[1])The keep parameter accepts 'first', 'last', or False. 'first' marks duplicates except the first occurrence.
Fill both blanks to create a dictionary of word lengths for words longer than 3 letters.
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 words and their lengths for words longer than 4 letters.
result = {{ [1]: [2] for w in words if len(w) [3] 4 }}This comprehension creates a dictionary with uppercase words as keys and their lengths as values, filtering words longer than 4.