擅长:python、mysql、java
<p>熊猫还有<code>kde</code>图:</p>
<pre><code>hist, bins = np.histogram(X, bins=10,density=True)
width = 0.7 * (bins[1] - bins[0])
center = (bins[:-1] + bins[1:]) / 2
plt.bar(center, hist, align='center', width=width, zorder=1)
# density plot
df['A'].plot.kde(zorder=2, color='C1')
plt.show()
</code></pre>
<p>输出:</p>
<p><a href="https://i.stack.imgur.com/VikWQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VikWQ.png" alt="enter image description here"/></a></p>