Skip to content

ValueError: invalid __array_struct__ when assigning to object-dtype ndarray #16939

@TomAugspurger

Description

@TomAugspurger

Hi. Pandas is broken with numpy master :)

Reproducing code example:

In [1]: import numpy as np
In [2]: out = np.empty(3, dtype="object")
In [3]: out[:] = [np.int64, np.int64, np.int64]

Error message:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-3-d20bd885ed9b> in <module>
----> 1 out[:] = [np.int64, np.int64, np.int64]

ValueError: invalid __array_struct__

Numpy/Python version information:

Installed from a wheel with pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy

1.20.0.dev0+2d12d0c 3.7.6 (default, Dec 30 2019, 19:38:28)
[Clang 11.0.0 (clang-1100.0.33.16)]

I don't immediately see what commit could have caused this. #16850 mentions object-dtype scalars, but doesn't look quite right.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions