0

I tried the solution from this post Pandas calculating age from a date

df1['dob'] = pd.to_datetime(df1['dob'])
now = datetime.now()    
df1['age'] = now - df1['dob']

however it returns the result in terms of days then I tried

df1['age'] = (now - df1['dob'])/365 

to get the value in years but it the data look

74 days

my objective is to get 74 in the dataframe? am I missing something from the datetime module?

Dr.DOOM
  • 557
  • 2
  • 12
  • 35

0 Answers0