2024-09-27 09:32:46 发布
网友
以下是错误:
print numpy.linalg.norm(2) # returns 2 print numpy.linalg.norm(2, np.inf) # returns error, print numpy.linalg.norm(2, np.inf) # returns the same error: ValueError: Improper number of dimensions to norm.
如何在非numpy数组输入中使用上述规范?在
如the doc string所述:
In [165]: np.linalg.norm? Definition: np.linalg.norm(x, ord=None, axis=None) ... Parameters x : array_like Input array. If `axis` is None, `x` must be 1-D or 2-D.
norm的第一个参数应该是一个类似数组的对象。因此使用
norm
如the doc string所述:
^{pr2}$norm
的第一个参数应该是一个类似数组的对象。因此使用相关问题 更多 >
编程相关推荐