If your column is a string, you will need to first use `pd.to_datetime',
df['Date'] = pd.to_datetime(df['Date'])
Then, use .dt datetime accessor with strftime:
df = pd.DataFrame({'Date':pd.date_range('2017-01-01', periods = 60, freq='D')})
df.Date.dt.strftime('%Y-%m-%d').astype(int)
Or use lambda function:
df.Date.apply(lambda x: x.strftime('%Y-%m-%d')).astype(int)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…