Git Product home page Git Product logo

Comments (8)

wepe avatar wepe commented on July 25, 2024

你把line99换成这个试试

t3['this_month_user_receive_same_coupon_lastone'] = t3.max_date_received.astype('int') - t3.date_received.astype('int')

from o2o-coupon-usage-forecast.

BoyuanJiang avatar BoyuanJiang commented on July 25, 2024

@wepe
改了后得到了以下的错误
Traceback (most recent call last):
File "extract_feature.py", line 99, in
t3['this_month_user_receive_same_coupon_lastone'] = t3.max_date_received.astype('int') - t3.date_received.astype('int')
File "/usr/lib64/python2.7/site-packages/pandas/core/generic.py", line 3054, in astype
raise_on_error=raise_on_error, **kwargs)
File "/usr/lib64/python2.7/site-packages/pandas/core/internals.py", line 3189, in astype
return self.apply('astype', dtype=dtype, **kwargs)
File "/usr/lib64/python2.7/site-packages/pandas/core/internals.py", line 3056, in apply
applied = getattr(b, f)(**kwargs)
File "/usr/lib64/python2.7/site-packages/pandas/core/internals.py", line 461, in astype
values=values, **kwargs)
File "/usr/lib64/python2.7/site-packages/pandas/core/internals.py", line 504, in _astype
values = _astype_nansafe(values.ravel(), dtype, copy=True)
File "/usr/lib64/python2.7/site-packages/pandas/types/cast.py", line 531, in _astype_nansafe
raise ValueError('Cannot convert NA to integer')
ValueError: Cannot convert NA to integer

from o2o-coupon-usage-forecast.

wepe avatar wepe commented on July 25, 2024
ValueError: Cannot convert NA to integer

你应该是date_received这一列数据有问题,我的可以跑通,你确定一下自己下载的数据没问题? date_received字段的数据是 20160701 这种格式的。

from o2o-coupon-usage-forecast.

BoyuanJiang avatar BoyuanJiang commented on July 25, 2024

确定数据没有问题,
image
这个是执行line 99之前的t3的内容,我想会不会是我的pandas版本的问题,请问你的pandas的版本是多少?

from o2o-coupon-usage-forecast.

wepe avatar wepe commented on July 25, 2024

我的pandas 版本:0.18.1

from o2o-coupon-usage-forecast.

BoyuanJiang avatar BoyuanJiang commented on July 25, 2024

确实是我的原始数据有些问题,谢谢

from o2o-coupon-usage-forecast.

CXY573 avatar CXY573 commented on July 25, 2024

@BoyuanJiang 你用的数据不是作者提供的数据吗,我也出现你这个错误了 请问怎么解决的

from o2o-coupon-usage-forecast.

aojue1109 avatar aojue1109 commented on July 25, 2024

@BoyuanJiang 请问数据有什么问题,我也在这个点上出现了问题,不确定数据在哪里有问题

from o2o-coupon-usage-forecast.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.