Also tried this:
>>> pa.array([{'a': 1.0, 'b': 2.0}], pa.struct([pa.field('a',
pa.float64()), pa.field('b', pa.float64())]))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "array.pxi", line 56, in pyarrow.lib.array
File "error.pxi", line 85, in pyarrow.lib.check_status
pyarrow.lib.ArrowNotImplementedError: No type converter implemented for
struct<a: double, b: double>
On Mon, Dec 18, 2017 at 5:35 PM, Li Jin <[email protected]> wrote:
> Hey folks,
>
> What's best way to create a pyarrow.Array of struct? I tried to create a
> pyarrow.Array from a pd.Series of dict but doesn't seem to work (0.7.1):
>
> >>> s
>
> 0 {'a': 1, 'b': 2}
>
> Name: stats, dtype: object
>
> >>> pa.Array.from_pandas(s)
>
> Traceback (most recent call last):
>
> File "<stdin>", line 1, in <module>
>
> File "array.pxi", line 225, in pyarrow.lib.Array.from_pandas
>
> File "error.pxi", line 77, in pyarrow.lib.check_status
>
> pyarrow.lib.ArrowInvalid: Error inferring Arrow type for Python object
> array. Got Python object of type dict but can only handle these types:
> string, bool, float, int, date, time, decimal, list, array
>
> >>> pa.Array.from_pandas(df)
>
> Traceback (most recent call last):
>
> File "<stdin>", line 1, in <module>
>
> File "array.pxi", line 225, in pyarrow.lib.Array.from_pandas
>
> File "error.pxi", line 77, in pyarrow.lib.check_status
>
> pyarrow.lib.ArrowInvalid: Error inferring Arrow type for Python object
> array. Got Python object of type dict but can only handle these types:
> string, bool, float, int, date, time, decimal, list, array
>
>
> What's the correct way to do this?
>
>
>
>
>