I would like to extract a week number from data in a pandas dataframe.
The date format is datetime64[ns]
I have normalized the date to remove the time from i
from datetime import date df_date = pd.DataFrame([date.today()],columns = ['today']) print(df_date) #### Print Output #### # today #0 2019-09-07 df_date['weeknum'] = df_date.today.apply(lambda x:x.isocalendar()[1]) print(df_date) #### Print Output #### # today weeknum #0 2019-09-07 36