-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Open
Labels
Description
Describe the issue:
There is difference in scalar vs array handling of .astype(copy=False)
, arrays work as expected
Reproduce the code example:
import numpy as np
b = np.float64(1.1)
id(b), id(b.astype('float64', copy=False))
(140737303069360, 140737303069584)
id(b), id(np.astype(b, 'float64', copy=False))
(140737303069360, 140737303069424)
c = np.array([1.1], dtype='float64')
id(c), id(np.astype(c, 'float64', copy=False))
(140737302772592, 140737302772592)
Error message:
Python and NumPy Versions:
2.1.3
3.13.3 | packaged by conda-forge
Runtime Environment:
No response
Context for the issue:
No response