Hi,
trying the example here https://arrow.apache.org/docs/python/pandas.html on
DataFrames paragraph with python 2.7.17, numpy==1.16.2 , pandas ==0.20.3,
pyarrow==0.16.0 or pyarrow==0.15.1 got an error (see below).

import pandas as pd
import pyarrow as pa

df  = pd.DataFrame({"a": [1,2,3]})
table = pa.Table.from_pandas(df)

fails with the following stacktrace:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pyarrow/table.pxi", line 1177, in pyarrow.lib.Table.from_pandas
  File
"/home/ubuntu/.pyenv/versions/2.7.17/envs/py27/lib/python2.7/site-packages/pyarrow/pandas_compat.py",
line 593, in dataframe_to_arrays
    types)
  File
"/home/ubuntu/.pyenv/versions/2.7.17/envs/py27/lib/python2.7/site-packages/pyarrow/pandas_compat.py",
line 234, in construct_metadata
    metadata = _get_simple_index_descriptor(level, name)
  File
"/home/ubuntu/.pyenv/versions/2.7.17/envs/py27/lib/python2.7/site-packages/pyarrow/pandas_compat.py",
line 255, in _get_simple_index_descriptor
    pandas_type = get_logical_type_from_numpy(level)
  File
"/home/ubuntu/.pyenv/versions/2.7.17/envs/py27/lib/python2.7/site-packages/pyarrow/pandas_compat.py",
line 113, in get_logical_type_from_numpy
    result = _pandas_api.infer_dtype(pandas_collection)
  File "pyarrow/pandas-shim.pxi", line 131, in
pyarrow.lib._PandasAPIShim.infer_dtype
  File "pyarrow/pandas-shim.pxi", line 134, in
pyarrow.lib._PandasAPIShim.infer_dtype
TypeError: infer_dtype() takes no keyword arguments

Is some known bug, some incompatibility or some mis-configuration?
Thank you very much,
Filippo Medri

Reply via email to