numpy有个直方图函数histogram,比如说
np.histogram(a, bins=20)但是这个函数的返回结果并不显示出图像,这该怎么办?
1个回答
np.histogram不能直接生成直方图,np.histogram返回的是每个bin的上下界和每个bin里的样本的个数
如果需要显示出图像的话可以用matplotlib
import matplotlib.pyplot as plt
plt.hist(a, bins=20)
plt.show()SofaSofa数据科学社区DS面试题库 DS面经
				明白了,多谢!
				- 
             yangyang
           
				
          
          2018-11-14 16:21
			
    
  相关讨论
  随便看看