弃用警告:不推荐在 `op_axes` 为 NULL 时使用 `oa_ndim == 0` [英] DeprecationWarning: using `oa_ndim == 0` when `op_axes` is NULL is deprecated
本文介绍了弃用警告:不推荐在 `op_axes` 为 NULL 时使用 `oa_ndim == 0`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何防止此异常?
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)
它是在我执行以下操作时生成的:
It is generated when I do the following:
df = pd.DataFrame( np.random.randn(1000,59))
df2=df**2
如果我制作一个较小的数据框,它似乎不会发生.例如
It does not seem to occur if I make a smaller dataframe. e.g.
df = pd.DataFrame( np.random.randn(1000,10))
我的熊猫版本是 0.13.1我的 numpy 版本是 1.8.1
My pandas version is 0.13.1 My numpy version is 1.8.1
推荐答案
我通过更新 numexpr 设法解决了这个问题.我从命令行使用 Conda 做到了这一点:
I managed to fix the problem by updating numexpr. I did this using Conda from the command line:
conda update -n p33 numexpr
这篇关于弃用警告:不推荐在 `op_axes` 为 NULL 时使用 `oa_ndim == 0`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文