值错误:操作数不能与形状一起广播

2024-04-29 12:46:30 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个形状为(6,2)的Numpy数组

a = array([[1, 2, 3, 3, 2, 1],
           [4, 5, 6, 7, 8, 9]])

我想使用 np.power(a, [-6,-8])但这会提高ValueError: operands could not be broadcast together with shapes。我该怎么做?谢谢!


Tags: numpywithnpnot数组bearraycould