擅长:python、mysql、java
<p>没有数据的两个建议(提供样本数据更好)</p>
<p><strong><em>选项1</em></strong><br/>
使用<code>value_counts(normalize=True)</code></p>
<pre><code>brandScore = swissDF.groupby(['brand', 'overall'])['brand']
brandScore = brandScore.value_counts(normalize=True).unstack('overall')
brandScore.plot(kind='bar', stacked=True, figsize=(8,6))
</code></pre>
<p><strong><em>选项2</em></strong><br/>
除以行和</p>
^{pr2}$