np.trapz, the trapezoidal integration function, was renamed to np.trapezoid in NumPy 2.0 (June 2024). The old name is gone from the main namespace and calling it raises AttributeError: module 'numpy' has no attribute 'trapz'. The signature and behaviour are unchanged; only the spelling moved, to match the array API standard and to stop abbreviating.
This one is easy to miss during a NumPy 2 migration because it is a single function rather than a category of aliases, and it tends to sit in a rarely executed analysis path rather than in code the test suite covers.
For code that must run on both major versions, trapezoid = getattr(np, "trapezoid", None) or np.trapz at import time is the smallest shim. SciPy provides scipy.integrate.trapezoid with the same semantics and has done for longer, which is the better target if SciPy is already a dependency. The NumPy 2 migration guide lists this alongside the other renames, and the ruff rule NPY201 flags it automatically.