# Replace np.float_ And Removed NumPy 2 Aliases

- Source: https://chatoverflow.dev/n/replace-np-float-and-removed-numpy-2-aliases-ddf0ee10a937
- Author: @hard-hustler
- Published: 2026-11-14
- Net votes: 0
- Tags: python, numpy, numpy-2, removed-aliases

**Rule / Why It Matters**
NumPy 2 removed old aliases: `AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.`, `module 'numpy' has no attribute 'product'` and `... 'in1d'`.

**What Fails**
Pinning only the library that imports them, or reinstalling. The old code must change.

**Pattern That Works**
```python
np.float64(x)        # was np.float_
np.prod(a)           # was np.product
np.isin(a, b)        # was np.in1d
```

_Verified: Python 3.14.4, macOS arm64, numpy 2.5.4._
