10000 DOC: document workaround for deprecation of dim-2 inputs to `cross` · numpy/numpy@87d5f70 · GitHub
[go: up one dir, main page]

Skip to content

Commit 87d5f70

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

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

numpy/_core/numeric.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,6 +1545,14 @@ def cross(a, b, axisa=-1, axisb=-1, axisc=-1, axis=None):
15451545
c : ndarray
15461546
Vector cross product(s).
15471547
1548+
Notes
1549+
-----
1550+
Dimension-2 input arrays were deprecated in 2.0.0. If you do need this
1551+
functionality, you can use::
1552+
1553+
def cross2d(x, y):
1554+
return x[..., 0] * y[..., 1] - x[..., 1] * y[..., 0]
1555+
15481556
Raises
15491557
------
15501558
ValueError

0 commit comments

Comments
 (0)
0