import pandas as pd
# I have taken an example. You could do a pd.read_csv(filename) to read from file
#Input in dd-mm-yyyy format
df = pd.DataFrame({'DOB': {0: '26-01-2016', 1: '26-01-2016'}})
#Convert to pandas datetime object
df['DOB'] = pd.to_datetime(df.DOB)
#Convert to dd/mm/yyyy format('%d/%m/%Y')
df['DOB'] = df['DOB'].dt.strftime('%d/%m/%Y')
You can read more here: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.dt.strftime.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.