运行后出现此错误:
(100*df.isna().sum()/df.shape[0]).round(1)
我使用 Jupyter (Anaconda)。
这是我得到的完整错误:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-20-e4ddd4ac043f> in <module>
----> 1 (100*df.isna().sum()/df.shape[0]).round(1)
~\Anaconda3\lib\site-packages\pandas\core\ops\__init__.py in wrapper(left, right)
1046
1047 with np.errstate(all="ignore"):
-> 1048 result = na_op(lvalues, rvalues)
1049 return construct_result(
1050 left, result, index=left.index, name=res_name, dtype=None
~\Anaconda3\lib\site-packages\pandas\core\ops\__init__.py in na_op(x, y)
963 TypeError : invalid operation
964 """
--> 965 import pandas.core.computation.expressions as expressions
966
967 try:
~\Anaconda3\lib\site-packages\pandas\core\computation\expressions.py in <module>
17 from pandas.core.dtypes.generic import ABCDataFrame
18
---> 19 from pandas.core.computation.check import _NUMEXPR_INSTALLED
20
21 if _NUMEXPR_INSTALLED:
~\Anaconda3\lib\site-packages\pandas\core\computation\check.py in <module>
1 from pandas.compat._optional import import_optional_dependency
2
----> 3 ne = import_optional_dependency("numexpr", raise_on_missing=False, on_version="warn")
4 _NUMEXPR_INSTALLED = ne is not None
5 if _NUMEXPR_INSTALLED:
~\Anaconda3\lib\site-packages\pandas\compat\_optional.py in import_optional_dependency(name, extra, raise_on_missing, on_version)
97 minimum_version = VERSIONS.get(name)
98 if minimum_version:
---> 99 version = _get_version(module)
100 if distutils.version.LooseVersion(version) < minimum_version:
101 assert on_version in {"warn", "raise", "ignore"}
~\Anaconda3\lib\site-packages\pandas\compat\_optional.py in _get_version(module)
46
47 if version is None:
---> 48 raise ImportError("Can't determine version for {}".format(module.__name__))
49 return version
50
ImportError: Can't determine version for numexpr
它是在我更新我的 scikit-learn 之后开始的。我试过这个,我仍然有这个问题。我能做些什么来修复它?