Skip to content

Broadcasting not working with record array with a single record #6085

@dashesy

Description

@dashesy

This code:

    _p = np.empty(1, dtype=[('p', np.uint16), ('pr', np.uint16)])
    _p[:] = 1

Throws this exception:

TypeError: expected a readable buffer object

However this code works fine:

    _p = np.empty(2, dtype=[('p', np.uint16), ('pr', np.uint16)])
    _p[:] = 1

_p.fill(1) works in both cases.

This is with version 1.8.2

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