擅长:python、mysql、java
<p>您可以旋转数据帧。在</p>
<pre><code>df.pivot(index='group1', columns='group2', values='reject')
group2 dry_sed junc_hal other_trees phrag water wet_sed
group1
bacc True False False True True False
dry_sed None True True True True True
junc_hal None None False True True False
other_trees None None None True True True
phrag None None None None True True
water None None None None None True
</code></pre>