Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in extract_feature.py #1

Open
jianchengss opened this issue Sep 28, 2017 · 3 comments
Open

Error in extract_feature.py #1

jianchengss opened this issue Sep 28, 2017 · 3 comments

Comments

@jianchengss
Copy link

t3['this_month_user_receive_same_coupon_lastone'] = t3.max_date_received - t3.date_received

t3['this_month_user_receive_same_coupon_lastone'] = t3.max_date_received - t3.date_received
unsupported operand type(s) for -: 'float' and 'str'
type(t3.date_received[0]) : <type 'str'>
type(t3.max_date_received[0]) : <type 'numpy.float64'>
@InsaneLife
Copy link
Owner

python=2.7
if you use python=3.X, there could be mistakes.

@jianchengss
Copy link
Author

I use python 2.7 already, still going to go wrong.

@InsaneLife
Copy link
Owner

I have read your error, you should change max_date_received to float:
t3['max_date_received'] = t3.max_date_received.astype(float)
t3['this_month_user_receive_same_coupon_lastone'] = t3.max_date_received - t3.date_received

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants