Convert DOB to age

Your DOB column doesn’t actually contain strings with slashes in them (what strptime would convert). It contains instances of Pandas’ Timestamp class. To work with these, see the documentation etc. according to your intended approach to the problem:

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Timestamp.html

https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Timestamp.now.html

For future posts, please read the pinned thread in order to understand how to format code properly.

1 Like