DeprecationWarning:当 `op_axes` 为 NULL 时使用 `oa_ndim == 0` 已被弃用

2024-05-01

我如何防止这种异常?

C:\Anaconda\envs\p33\lib\site-packages\numexpr\necompiler.py:742: DeprecationWarning: using `oa_ndim == 0` when `op_axes` is NULL is deprecated. Use `oa_ndim == -1` or the MultiNew iterator for NumPy <1.8 compatibility
  return compiled_ex(*arguments, **kwargs)

当我执行以下操作时会生成它:

df = pd.DataFrame( np.random.randn(1000,59))
df2=df**2

如果我制作较小的数据框,似乎不会发生这种情况。例如

df = pd.DataFrame( np.random.randn(1000,10))

我的pandas版本是0.13.1 我的numpy版本是1.8.1


我设法通过更新 numexpr 解决了该问题。我从命令行使用 Conda 执行此操作:

conda update -n p33 numexpr
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

DeprecationWarning:当 `op_axes` 为 NULL 时使用 `oa_ndim == 0` 已被弃用 的相关文章

随机推荐