包含从SAS导入的数据的python数据框“dff”具有日期字段,其类型由python显示如下:
dff.effvdate.head()
Out[47]:
0 b'09JUL2013'
1 b'17OCT2013'
2 b'03MAR2014'
3 b'08MAY2014'
4 b'10MAR2015'
Name: effvdate, dtype: object
我正在尝试将此日期转换为日期类型,如下所示:
^{pr2}$显示此错误
TypeError: strptime() argument 1 must be str, not bytes
因为我是python新手,需要帮助。在
错误
TypeError: strptime() argument 1 must be str, not bytes
提供了您需要知道的信息!d
以字节为单位,不是字符串。你应该把d放在弦上。在应该行得通。在
见What does the 'b' character do in front of a string literal?
相关问题 更多 >
编程相关推荐