Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: Bad error message when constructing memoryview from structured view #10389

Closed
@eric-wieser

Description

@eric-wieser

As instructed by the error message:

data = np.zeros(1, dtype=[('a', int), ('b', float)])
data = data[['b','a']]
memoryview(data)
# RuntimeError: This should never happen: Invalid offset in buffer format string generation. Please report a bug to the Numpy developers.

I don't think this can be fixed, but the error message can certainly explain that a field reorder is required.

cc @ahaldane due to #6053

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