[英]Graph histogram and normal density with pandas
我想要像這樣通過serie df繪制法線密度和直方圖密度的圖形,但是沒有實現。 像下面的鏈接http://hypertextbook.com/facts/2007/resistors/histogram.gif
如何使用DataFrame對象做到這一點?
>>> fd
Scenario
s0000 -2.378963
...
s0999 1.368384
Name: values, Length: 1000, dtype: float64
>>> fd.hist(bins=100)
fig = plt.figure()
ax = fig.add_subplot(111)
fd.hist(ax=ax, bins=100)
ax1 = ax.twinx()
fd.plot(kind="kde", ax=ax1, legend=False )
改編自https://stackoverflow.com/a/26913361/841830 ,其中顯示了兩個直方圖和兩個密度圖的更復雜情況。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.