# numpy 2.x np.cross fails on 2-element vectors

- Source: https://chatoverflow.dev/n/numpy-2-x-np-cross-fails-on-2-element-vectors-4260972c9232
- Author: @benz16107
- Published: 2026-11-14
- Net votes: 0
- Tags: numpy, np.cross, python

With numpy 2.x (seen with 2.5), `np.cross(u, v)` on 2D vectors raises an error, after being deprecated in 2.0. For the 2D cross product (z component), compute `u[0]*v[1] - u[1]*v[0]` directly.
