O2O-Coupon-Usage-Forecast
O2O-Coupon-Usage-Forecast copied to clipboard
/wepon/season one 中extract_feature.py问题
请问在运行extract_feature.py时出现了这样的问题
Traceback (most recent call last):
File "extract_feature.py", line 60, in
不好意思这个是环境变量问题你File "/Library/Python/2.7/site-packages/pandas/core/ops.py", line 818, in na_op raise TypeError("invalid type comparison") 修改成\看看 在2018年3月8日 10:49,fannn1217[email protected]mailto:[email protected] 写道:
请问在运行extract_feature.py时出现了这样的问题 Traceback (most recent call last): File "extract_feature.py", line 60, in feature3 = off_train[((off_train.date>='20160315')&(off_train.date<='20160630'))|((off_train.date=='null')&(off_train.date_received>='20160315')&(off_train.date_received<='20160630'))] File "/Library/Python/2.7/site-packages/pandas/core/ops.py", line 879, in wrapper res = na_op(values, other) File "/Library/Python/2.7/site-packages/pandas/core/ops.py", line 818, in na_op raise TypeError("invalid type comparison") TypeError: invalid type comparison 怎么解决呢
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/wepe/O2O-Coupon-Usage-Forecast/issues/12, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMAaSHvNq5g_zki3cCH5mBrqd54wLFt5ks5tcJwUgaJpZM4SiDaZ.
你好请问下,这个怎么解决的?
解决了,在读取train文件时设置keep_default_na = False..我的是py3.可能就是nan的问题!
@WorldBestGaming 您好,请问你的nan问题是如何解决,我遇到了这个问题“ValueError: invalid literal for int() with base 10: 'nan'”。
@iimmortall 你pandas读取文件时,有个参数是keep_default_na你设置一下False就ok了。
Cause there so many pd.read_csv..so when trackback the code ,which operaion should I change 'keep_defau.lt_na=False‘.I've changed some but the result is negative..
@RobertMarton i can`t understand you say that the result is negative.= =! emmm
Emmm, I added 'keep_default_na=False' in code
"off_train = pd.read_csv('data/ccf_offline_stage1_train.csv',header=None,keep_default_na=False)"&
"on_train = pd.read_csv('data/ccf_online_stage1_train.csv',header=None,keep_default_na=False)"
But the error still exist like below =-= :
t3['user_merchant_any'] = 1
(112803, 52)
(257126, 53)
Traceback (most recent call last):
File "extract_feature.py", line 1031, in
I changed some code then ,when running xgb.py occurs error below: "Check failed: !auc_error AUC: the dataset only contains pos or neg samples" But the label column in dataset1.csv is all value 0 ,so is this normal?
@RobertMarton How duo you solve this
elif (date(int(s[0][0:4]),int(s[0][4:6]),int(s[0][6:8]))-date(int(s[1][0:4]),int(s[1][4:6]),int(s[1][6:8]))).days<=15:
ValueError: invalid literal for int() with base 10: 'nan'
i also see this in my code. help me plz.
@RobertMarton emmmm. My solution is based on python3.your enviorment is py2.I guess the data format is a problem, you can try to change utf-8. = =!
nan的问题在比较前先把那列fillna('null')