![](/img/trans.png)
[英]How to solve type object 'Series' has no attribute '_get_dtypes' error using modin.pandas?
[英]import modin.pandas causes ERROR: AttributeError: type object 'pyarrow.lib.Message' has no attribute '__reduce_cython__'
問題
conda install -c conda-forge modin
import modin.pandas as pd
嘗試過的解決方案
錯誤信息
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-f6aea802f5ba> in <module>
2 import openpyxl
3
----> 4 import modin.pandas as pd
5 ##import pandas as pd
6
~/anaconda3/envs/tfall/lib/python3.7/site-packages/modin/pandas/__init__.py in <module>
170
171 from .. import __version__
--> 172 from .dataframe import DataFrame
173 from .io import (
174 read_csv,
~/anaconda3/envs/tfall/lib/python3.7/site-packages/modin/pandas/dataframe.py in <module>
46 from .series import Series
47 from .base import BasePandasDataset, _ATTRS_NO_LOOKUP
---> 48 from .groupby import DataFrameGroupBy
49 from .accessor import CachedAccessor, SparseFrameAccessor
50
~/anaconda3/envs/tfall/lib/python3.7/site-packages/modin/pandas/groupby.py in <module>
32 wrap_into_list,
33 )
---> 34 from modin.backends.base.query_compiler import BaseQueryCompiler
35 from modin.data_management.functions.default_methods.groupby_default import GroupBy
36 from modin.config import IsExperimental
~/anaconda3/envs/tfall/lib/python3.7/site-packages/modin/backends/__init__.py in <module>
17 __all__ = ["BaseQueryCompiler", "PandasQueryCompiler"]
18 try:
---> 19 from .pyarrow import PyarrowQueryCompiler # noqa: F401
20 except ImportError:
21 pass
~/anaconda3/envs/tfall/lib/python3.7/site-packages/modin/backends/pyarrow/__init__.py in <module>
14 """The module represents the query compiler level for the PyArrow backend."""
15
---> 16 from .query_compiler import PyarrowQueryCompiler
17
18 __all__ = ["PyarrowQueryCompiler"]
~/anaconda3/envs/tfall/lib/python3.7/site-packages/modin/backends/pyarrow/query_compiler.py in <module>
26 from pandas.core.computation.ops import UnaryOp, BinOp, Term, MathCall, Constant
27
---> 28 import pyarrow as pa
29 import pyarrow.gandiva as gandiva
30
~/anaconda3/envs/tfall/lib/python3.7/site-packages/pyarrow/__init__.py in <module>
52
53
---> 54 from pyarrow.lib import cpu_count, set_cpu_count
55 from pyarrow.lib import (null, bool_,
56 int8, int16, int32, int64,
~/anaconda3/envs/tfall/lib/python3.7/site-packages/pyarrow/ipc.pxi in init pyarrow.lib()
AttributeError: type object 'pyarrow.lib.Message' has no attribute '__reduce_cython__'
解決方案
conda install -c conda-forge modin-all
工作代碼
import modin.pandas as pd
from distributed import Client
client = Client()
df = pd.read_csv('my_data.csv')
df
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.