Closed
Description
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