I would like to convert a column of a dataframe containing weekday integers into its corresponding weekday name. So 0 should become Monday, 1 Tuesday and so forth.
I have tried to convert the integers into a datetime format but it does not work. What is the best way to go about it?
data = {'weekday_number': [1, 2, 0, 3, 4, 5, 6, 3, 2, 5, 4, 5]}
df = pd.DataFrame(data)
df['weekday_name'] = pd.to_datetime(df['weekday_number']).dt.strftime('%A')