Traceback (most recent call last):
File "E:/nudt/DataMining_TianChI/Fno0/Duizhao/Main.py", line 67, in
offline,testPart,labelData = loadData()
File "E:/nudt/DataMining_TianChI/Fno0/Duizhao/Main.py", line 43, in loadData
offline = prepare.preprocess(offline)
File "E:\nudt\DataMining_TianChI\Fno0\Duizhao\prepare.py", line 13, in preprocess
data['date_received'] = data[data.Date_received != 'null'].Date_received.map(lambda x : datetime.datetime(int(str(x)[0:4]),int(str(x)[4:6]),int(str(x)[6:8]))) #转为时间格式
File "D:\ProgramData\Anaconda3\lib\site-packages\pandas\core\series.py", line 2354, in map
new_values = map_f(values, arg)
File "pandas/_libs/src/inference.pyx", line 1521, in pandas._libs.lib.map_infer
File "E:\nudt\DataMining_TianChI\Fno0\Duizhao\prepare.py", line 13, in
data['date_received'] = data[data.Date_received != 'null'].Date_received.map(lambda x : datetime.datetime(int(str(x)[0:4]),int(str(x)[4:6]),int(str(x)[6:8]))) #转为时间格式
ValueError: invalid literal for int() with base 10: 'nan'
在运行您的代码时,我这总会出错,想着是不是我的环境配置有问题。 所以我想问问您的环境大概是什么样的,我按照您的配置一下看是否能够运行成功。