8000 DOC: np.append docs should explain how appending different dtypes works · Issue #26291 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
DOC: np.append docs should explain how appending different dtypes works #26291
Closed
@Fleyderer

Description

@Fleyderer

Describe the issue:

When trying to append empty list to existing array, numpy array changes its dtype. This is absolutely not obvious behaviour and I've barely found this problem.

It may sound like minor problem, but in my case it was a reason of not deleting about 50k images by its indices, when I had to.

Reproduce the code example:

a = np.array([1, 2], dtype=int)
b = []
np.append(a, b) # array([1., 2.])

Error message:

No response

Python and NumPy Versions:

Python 3.11.5
Numpy 1.26.4

Runtime Environment:

No response

Context for the issue:

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0