I'm attempting to convert a date to a weekday - a least the weekday number, 0 for Monday, 1 for Tuesday etc. The date is an object data type.
When I try to find information/help to convert date to weekday, or adding a new dataframe column called 'weekday' and doing the conversion into there, I can't find anything on Python
I found this:
data.loc[:,'weekday'] = data.index.weekday
but it doesn't seem to work, as I get this error:
AttributeError: 'Int64Index' object has no attribute 'weekday'
There are no easy to find examples. Can anyone help?