import pandas as pd
import numpy as np
dic={'id':['a','b','c','d'],
'time1':[20200101,20200102,20200103,20200104],
'time2':['20200101','20200102','20200103','20200104']
}
df=pd.DataFrame(dic)
print(df)
id time1 time2
0 a 20200101 20200101
1 b 20200102 20200102
2 c 20200103 20200103
3 d 20200104 20200104
<class 'pandas.core.frame.DataFrame'>
将time1 time2 转化成时间类型2020-01-01