擅长:python、mysql、java
<p>可以执行以下操作并按grouped.groups显示组,这将为您提供组及其索引。但是,将序列传递给groupby的唯一缩减是序列将具有与数据帧相同的长度</p>
<pre><code>df=pd.DataFrame(ContinentDict.items())#dict to dataframe
df.columns=['Country','Continent']#dataframe columns
df.groupby('Continent').groups#groupby and get groups
</code></pre>