元数据推断失败

时间:2018-07-04 06:22:30

标签: dask dask-delayed

我正在制作一个更高的抽象模块,在dask上方命名为edask,该接口像pandas API一样接口,并在内部使用dask API。 我在解析此行代码时遇到问题:

pts = task[(task.task_date <= dtm.Time.iloc[i]) & (task.T_Date == dtm.Date.iloc[i])]

我已经能够将task.task_date形成为黄昏系列对象,并将 dtm.Time.iloc [i] 形成为 dask对象,该对象在计算时会给出一个datetime对象。

但是我认为,dask无法推断元数据的类型并引发以下错误。

Traceback (most recent call last):
  File "sdfr_dhruvkmr.py", line 465, in <module>
    pts = task[(task.task_date <= dtm.Time.iloc[i]) & (task.T_Date == dtm.Date.iloc[i])]
  File "/usr/lib/python2.7/site-packages/edask/dask/dataframe/core.py", line 1112, in <lambda>
    return lambda self, other: elemwise(op, self, other)
  File "/usr/lib/python2.7/site-packages/edask/dask/dataframe/core.py", line 3184, in elemwise
    meta = partial_by_order(*parts, function=op, other=other)
  File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/lib/python2.7/site-packages/edask/dask/dataframe/utils.py", line 154, in raise_on_meta_error
    raise ValueError(msg)
ValueError: Metadata inference failed in `le`.

Original error is below:
------------------------
TypeError('issubclass() arg 1 must be a class',)

Traceback:
---------
  File "/usr/lib/python2.7/site-packages/edask/dask/dataframe/utils.py", line 137, in raise_on_meta_error
    yield
  File "/usr/lib/python2.7/site-packages/edask/dask/dataframe/core.py", line 3184, in elemwise
    meta = partial_by_order(*parts, function=op, other=other)
  File "/usr/lib/python2.7/site-packages/edask/dask/utils.py", line 880, in partial_by_order
    return function(*args2, **kwargs)
  File "/usr/lib/python2.7/site-packages/pandas/core/ops.py", line 879, in wrapper
    res = na_op(values, other)
  File "/usr/lib/python2.7/site-packages/pandas/core/ops.py", line 791, in na_op
    if is_datetimelike_v_numeric(x, y):
  File "/usr/lib/python2.7/site-packages/pandas/core/dtypes/common.py", line 1314, in is_datetimelike_v_numeric
    return ((is_datetimelike(a) and is_numeric(b)) or
  File "/usr/lib/python2.7/site-packages/pandas/core/dtypes/common.py", line 1311, in is_numeric
    return is_integer_dtype(x) or is_float_dtype(x)
  File "/usr/lib/python2.7/site-packages/pandas/core/dtypes/common.py", line 820, in is_integer_dtype
    return (issubclass(tipo, np.integer) and

无论您有什么想法,请帮助我。

0 个答案:

没有答案