python - Extracting just Month and Year separately from Pandas Datetime column - Stack Overflow

PHOTO EMBED

Tue Jan 11 2022 04:36:37 GMT+0000 (Coordinated Universal Time)

Saved by @Bambibo9799 #python

df['year'] = df['insert_dataframe_here'].dt.year
df['month'] = df['insert_dataframe_here'].dt.month
content_copyCOPY

untuk nge extract tanggal date menjadi bulan ataupun tahun pada values row

https://stackoverflow.com/questions/25146121/extracting-just-month-and-year-separately-from-pandas-datetime-column?answertab