TypeError:|TypeError: an integer is required (got type str)
这里是把时间戳转化为正常时间碰到的问题:
运行traindata['context_timestamp']=traindata['context_timestamp'].apply(transform_time)报错如下(其中transform_time是自己已经定义好的时间戳转化函数):
文章图片
百度了一下还是不知道哪里出错,然后自己
【TypeError:|TypeError: an integer is required (got type str)】traindata.info(),数据类型如下:
文章图片
后来就瞎弄,最后好了,其实就是加了一个类型转化:
traindata['context_timestamp']=traindata['context_timestamp'].astype('int').apply(transform_time)
推荐阅读
- 由Uncaught|由Uncaught TypeError: this.player.startMoveAt is not a function引申
- codility|codility 之 MissingInteger
- Python|Python TypeError: 'module' object is not callable 原因分析
- RCTBridge|RCTBridge required dispatch_sync to load RCTDevLoadingView. This may lead to deadlocks
- Integer常量池结合源码解析
- Codeforces Round #609 (Div. 2)——C. Long Beautiful Integer(思维)
- Different Integers
- 用BigInteger演示RSA非对称加密算法
- LeetCode|【LeetCode013算法/编程练习C++】Roman to Integer //难得击败了80%的人
- python-Error Message: 'float' object cannot be interpreted as an integer