python錯誤提示:TypeError: ‘numpy.float64’ object cannot be interpreted as an integer

** TypeError: ‘numpy.float64’ object cannot be interpreted as an integer ** 出現此情況的原因是plt.hist(normal_values, np.sqrt(N), normed=True, lw=1)中的np.sqrt(N)是浮點型數據,而hist要求是int型數據,所有加上int(np.sqrt(N))
相關文章
相關標籤/搜索