I am using an AirBnb dataset. I have a column, 'host_since'. The column contains date objects in the format of 'DD/MM/YYYY': for example, 24/09/2008. The columns' data shows the date that an individual became a host.
I want to create a new column in my dataframe that contains the the number of days since the host first joined. I am aware of the to_datetime
method but cant quite understand the documentation.
note: df['host_days'] does not exist in the df. I want to create a column then assign the appropriate steps to get my outcome
def add_host_days(df):
df['host_days'] = df['host_since'].to_datetime()
return df
Any ideas on how to do so? Thank you for your input.