我如何用沙尔暗的 lo子写下以下的 lo子?
def kl(myA, myB, a, b):
lots of stuff that assumes all inputs are scalars
x, y = meshgrid(inclusive_arange(0.0, xsize, 0.10),
inclusive_arange(0.0, ysize, 0.10))
for j in range(x.shape[0]):
for i in range(x.shape[1]):
z[j, i] = kl(x[j, i], y[j, i])
我想做的是这样的事情。
z = kl(x, y)
但这提供了:
TypeError: only length-1 arrays can be converted to Python scalars