我有一个值为Mar18,Apr18,Jun18
的列。
我正在尝试转换成201803,201804,201806
这样的日期格式。
我写了我的语法如下:
pd.to_datetime(df['column'],format'%b%y')
这给了我一个2018-03-01,2018-04-01,2018-06-01
列。你知道吗
如何将其转换为201803,201804,201806
这样的日期数据类型
我应该使用什么格式类型。你知道吗
你知道吗注意:如果是一个重复的问题,请指给我上一个问题。你知道吗
谢谢
Tags:
请注意,这是而不是日期时间数据类型-这是字符串数据类型
或者,您可以将其转换为^{} dtype :
相关问题 更多 >
编程相关推荐