The corresponding data of this year is displayed as 06.14, The data of last year and the previous year show that 2021.12.27
month=['01','02','03','04','05','06','07','08','09','10','11','12']
date_pre=[]
for i in df['date']:
if i.split('.')[0] in month:
i='2022.'+i
i=i.replace('.','-')
# print(i) #str 2022-06-12
i=datetime.date(*map(int,i.split('-')))
date_pre.append(i)
else:
i=i.replace('.','-')
i=datetime.date(*map(int,i.split('-')))
date_pre.append(i)
df['date_pre']=pd.DataFrame(data=date_pre)
Form like : 2019-03-14 <class 'datetime.date'>
python Change string type to date type _Python Learners' blogs -CSDN Blog _python String to date format
# One 、 Find websites ##( One
When using Appium automation,