Complete the code to extract the year from the 'date' column in the DataFrame.
df['year'] = df['date'].dt.[1]
dt accessor.The dt.year attribute extracts the year part from datetime values in a pandas Series.
Complete the code to extract the month from the 'date' column in the DataFrame.
df['month'] = df['date'].dt.[1]
dt accessor.The dt.month attribute extracts the month part from datetime values in a pandas Series.
Fix the error in the code to extract the day from the 'date' column in the DataFrame.
df['day'] = df['date'].[1]
df['date'].day without dt accessor.dt.day() which is invalid.To extract the day, you must use the dt accessor followed by day without parentheses: dt.day.
Fill both blanks to create a dictionary with words as keys and their lengths as values, but only for words longer than 3 letters.
lengths = {word: [1] for word in words if [2] > 3}The dictionary comprehension uses len(word) to get the length and filters words with length greater than 3.
Fill all three blanks to create a dictionary with uppercase words as keys and their lengths as values, only for words longer than 3 letters.
result = { [1]: [2] for word in words if [3] > 3 }The dictionary comprehension uses word.upper() as keys, len(word) as values, and filters words longer than 3 letters.