df.column_1:
had 2 months of ownership
had 1 week of ownership
had 2 years of ownership
I want to convert ownership time to date in df.column_1. The expected output is:
df.column_1:
60
7
730
Below is what I have so far:
df['column_1'] = df['column_1'].str.split(r'\D').str.get(1)
But this only gives the second string (e.g. 2, 1, 2). I was planning to get second and third strings (e.g. 2 months) and convert them to date.