900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > 将时间戳“年月日 时分秒”格式转换成“年月日”格式

将时间戳“年月日 时分秒”格式转换成“年月日”格式

时间:2022-06-27 04:09:12

相关推荐

将时间戳“年月日 时分秒”格式转换成“年月日”格式

将时间戳“年月日 时分秒”格式转换成“年月日”格式

将时间戳“年月日 时分秒”格式转换成“年月日”格式

总是忘记要重新查找方法,现在把它写在这儿记住!

#转换时间格式print(type(frame['日期'].loc[0])) #这里的‘日期’是要转换格式的日期列listdate = []for i in frame['日期']:if type(i) == pd._libs.tslibs.timestamps.Timestamp:i = i.strftime('%Y-%m-%d')listdate.append(i)frame['日期'] = listdate #新的转换好格式的日期列赋值

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。