Complete the code to apply a function to each element in the 'age' column.
df['age'] = df['age'].[1](lambda x: x + 1)
The apply method lets you run a function on each element of a column.
Complete the code to apply a function to each column in the DataFrame.
result = df.[1](sum)The apply method on a DataFrame applies a function to each column by default.
Fix the error in applying a function to each column to get the max value.
max_values = df.[1](max)To get max values per column, use apply with max function.
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 uses len(word) as value and filters words with length greater than 3.
Fill all three blanks to create a dictionary of uppercase words and their lengths for words longer than 4 characters.
result = {{ [1]: [2] for word in words if len(word) [3] 4 }}The dictionary comprehension keys are uppercase words, values are lengths, filtered by length greater than 4.