更新时间:2022-01-03 18:28:45
非 numpy 函数,如 math.abs()
或 math.log10()
不与 numpy 数组一起玩得很好.只需将引发错误的行替换为:
Non-numpy functions like math.abs()
or math.log10()
don't play nicely with numpy arrays. Just replace the line raising an error with:
m = np.log10(np.abs(x))
除此之外,np.polyfit()
调用将不起作用,因为它缺少一个参数(并且您没有分配结果以供进一步使用).
Apart from that the np.polyfit()
call will not work because it is missing a parameter (and you are not assigning the result for further use anyway).