Complete the code to select rows where the 'Name' column contains the letter 'a'.
filtered = df[df['Name'].str.[1]('a')]
The contains method checks if the pattern exists anywhere in the string.
Complete the code to replace all digits in the 'Code' column with '#' symbol.
df['Code'] = df['Code'].str.[1]('\d', '#')
The replace method replaces all occurrences of the regex pattern with the given string.
Fix the error in the code to find all words starting with 'a' in the 'Text' column.
df['Words'] = df['Text'].str.[1]('\ba\w*')
The findall method returns all matches of the regex pattern in each string.
Fill both blanks to create a dictionary with words as keys and their lengths as values, only for words longer than 3 letters.
lengths = {word: [1] for word in words if len(word) [2] 3}We want the length of each word as the value, and only include words longer than 3 letters.
Fill all three blanks to create a dictionary with uppercase words as keys, their counts as values, only for counts greater than 1.
result = [1]: [2] for word, count in counts.items() if count [3] 1}
The keys are uppercase words, values are counts, and we filter counts greater than 1.