import numpy def fun(x): return x**2 x = numpy.array(range(5)) # 矢量化写法 vec_fun = numpy.vectorize(fun) vec_res = vec_fun(x) # 循环写法 ...
確定! 回上一頁