Explore Library
Code QuizIntermediate

Extracting Month from a Date

Find why extracting the month from a datetime column fails with an attribute error.

Codepython
import pandas as pd

df['date'] = pd.to_datetime(df['date'])
df['month'] = df['date'].month

What is the bug in this code?