'Why doesn't my Python function convert the column to datetime format
I am trying to write a function to convert a column to datetime format (has to be in a function). When i run below however, it doesnt seem to do anything. Any ideas where i am going wrong?
data = pd.DataFrame({'DOB': {1: '01/04/1973', 2: '01/03/1979', 3: '22/06/2005', 4: '01/03/1994'}})
def update_col(df_name):
pd.to_datetime(df_name['DOB'])
update_col(data)
data
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
