TypeError:在绘图时,只有length-1数组可以转换… 投稿者 源码 2019-09-23 168 我有这样的Python代码: import numpy as np import matplotlib.pyplot as plt def f(x): return np.int(x) x = np.arange(1, 15.1, 0.1) plt.plot(x, f(x)) plt.show() 而这样的错误: TypeError: only length-1 arrays can be converted to Python scalars 我该如何解决? 百度未收录 赞(0) 赏 分享 本文由 投稿者 创作,文章地址:https://blog.isoyu.com/archives/typeerrorzaihuitushizhiyoulength-1shuzukeyizhuanhuan.html采用知识共享署名4.0 国际许可协议进行许可。除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为:9 月 23, 2019 at 01:18 下午
我有这样的Python代码: import numpy as np import matplotlib.pyplot as plt def f(x): return np.int(x) x = np.arange(1, 15.1, 0.1) plt.plot(x, f(x)) plt.show() 而这样的错误: TypeError: only length-1 arrays can be converted to Python scalars 我该如何解决? 百度未收录