Why can't numpy.cross produce correct answer for multi-dimensional array?

Viewed 119
import numpy as np

u = np.array([[195, 8, 9]], np.uint8)
v = np.array([250, 166, 68], np.int)
result1 = np.cross(v, u.astype(int))
result2 = np.cross(v, u)
result3 = np.cross(v, u[0])
print(result1, result2, result3)

output is

[[   950  11010 -30370]] [[182   2  94]] [   950  11010 -30370]

Why cant np.cross(v,u) produce correct answer, but np.cross(v,u[0]) can ? All results dtypes are numpy.int32

I'm using python 3.9.2 and numpy 1.20.1 .

0 Answers
Related