Complete the code to split the 'Name' column by spaces.
df['Name_split'] = df['Name'].str.[1](' ')
The str.split() method splits strings in a Series by the specified separator.
Complete the code to split the 'Address' column by commas.
df['Address_parts'] = df['Address'].str.[1](',')
To split text by commas, use str.split(',').
Fix the error in splitting the 'Data' column by semicolon.
df['Data_split'] = df['Data'].str.[1](';')
The correct method to split strings is str.split(), not join or others.
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 with uppercase keys and values greater than 0.
result = [1]: [2] for k, v in data.items() if v [3] 0}
This dictionary comprehension uses uppercase keys, keeps values, and filters values greater than zero.
