Skip to content

Commit 9fb7218

Browse files
committed
DOC: document workaround for deprecation of dim-2 inputs to cross
This addresses a part of numpygh-26620. The one-liner was verified and is likely to be used in a future `np.linalg.cross2d` function implementation, in numpygh-26640. [skip actions] [skip azp] [skip cirrus]
1 parent b52814f commit 9fb7218

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

numpy/_core/numeric.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,6 +1565,12 @@ def cross(a, b, axisa=-1, axisb=-1, axisc=-1, axis=None):
15651565
15661566
Supports full broadcasting of the inputs.
15671567
1568+
Dimension-2 input arrays were deprecated in 2.0.0. If you do need this
1569+
functionality, you can use::
1570+
1571+
def cross2d(x, y):
1572+
return x[..., 0] * y[..., 1] - x[..., 1] * y[..., 0]
1573+
15681574
Examples
15691575
--------
15701576
Vector cross-product.

0 commit comments

Comments
 (0)