Lets say I have a column 'MEMBERSHIP_LENGTH' with the value is integer for example, the value is 100 means this id had been a member for 100 days. I want to know what date this id applied for a membership from today.
So what I am thinking is
df['APPLIED_DATE'] = pd.to_datetime('2023-01-21') - timedelta(days=df['MEMBERSHIP_LENGTH'])
but I got an error TypeError: unsupported type for timedelta days component: Series.
How should I do it?
How about