dfply.mutate不适用于pandas.to_datetime

时间:2017-04-19 10:57:08

标签: python pandas datetime dfply

我有一个DataFrame

hub2['time'] = pd.to_datetime(hub2.timestamp)

有效,但是当我写

hub2 >> mutate(time=pd.to_datetime(X.timestamp))

https://github.com/kieferk/dfply 我收到了错误

Traceback (most recent call last): File "<input>", line 1, in <module> File "[...]/lib/python2.7/site-packages/pandas/util/decorators.py", line 91, in wrapper return func(*args, **kwargs) File "[...]/lib/python2.7/site-packages/pandas/tseries/tools.py", line 419, in to_datetime elif isinstance(arg, ABCSeries): File "[...]/lib/python2.7/site-packages/pandas/types/generic.py", line 9, in _check return getattr(inst, attr, '_typ') in comp TypeError: __nonzero__ should return bool or int, returned Call

为什么?

0 个答案:

没有答案