TypeError: an integer is required (got type str)
2018-03-18 21:47
2201 查看
这里是把时间戳转化为正常时间碰到的问题:
运行traindata['context_timestamp']=traindata['context_timestamp'].apply(transform_time)报错如下(其中transform_time是自己已经定义好的时间戳转化函数):
百度了一下还是不知道哪里出错,然后自己
traindata.info(),数据类型如下:
后来就瞎弄,最后好了,其实就是加了一个类型转化:
traindata['context_timestamp']=traindata['context_timestamp'].astype('int').apply(transform_time)
运行traindata['context_timestamp']=traindata['context_timestamp'].apply(transform_time)报错如下(其中transform_time是自己已经定义好的时间戳转化函数):
百度了一下还是不知道哪里出错,然后自己
traindata.info(),数据类型如下:
后来就瞎弄,最后好了,其实就是加了一个类型转化:
traindata['context_timestamp']=traindata['context_timestamp'].astype('int').apply(transform_time)
相关文章推荐
- python使用open经常报错:TypeError: an integer is required的解决方案
- TypeError: an integer is required
- Python 3.x: TypeError: a bytes-like object is required, not 'str'
- TypeError: a bytes-like object is required, not 'str'
- Python 3.5 Socket TypeError: a bytes-like object is required, not 'str' 错误提示
- TypeError: a bytes-like object is required, not 'str'
- python3.5 模拟UDP客户端发送数据报文,报错:TypeError: a bytes-like object is required, not 'str'
- python中Base64编码和解码:TypeError: a bytes-like object is required, not 'str'
- python write()参数错误,导致报错TypeError: a bytes-like object is required, not 'str'
- python 点滴记录4:TypeError: range() integer end argument expected, got str.
- python3中,socket使用send函数时出现的错误:TypeError: a bytes-like object is required, not 'str'
- python socket send 函数 报错:TypeError: a bytes-like object is required, not 'str'
- Python 3.x Error:TypeError: a bytes-like object is required, not 'str'
- Python中3+版本运行2+版本程序出现TypeError: a bytes-like object is required, not 'str'之读取PDF中的图片
- python 3.5: TypeError: a bytes-like object is required, not 'str' when writing to a file
- pip错误:TypeError: parse() got an unexpected keyword argument 'transport_encoding'
- 【ActiveMQ】管理界面查看消息详情,报错/WEB-INF/tags/form/forEachMapEntry.tag PWC6199: Generated servlet error: The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
- Keras TypeError: run() got an unexpected keyword argument 'class_mode'
- TypeError: __init__() got an unexpected keyword argument ‘default’
- CodeSign error: code signing is required for product type 'Unit Test Bundle' in SDK 'iOS 8.1'