dfply.mutate does not work with pandas.to_datetime

289 Views Asked by At

I have a DataFrame for which

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

works, but when I write

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

with https://github.com/kieferk/dfply I get the error

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

Why is that?

0

There are 0 best solutions below