find the max of column group by another column pandas
<p>I have a dataframe with 2 columns:</p>
<pre><code>count percent  grpno.
0          14.78       1
1           0.00       2
2           8.80       3
3           9.60       4
4          55.90       4
5           0.00       2
6           0.00       6
7           0.00       5
8           6.90       1
9          59.00       4
</code></pre>
<p>I need to get the max of column 'count percent
' and group by column 'grpno.'. Though I tried doing the same by</p>
<pre><code>geostat.groupby(['grpno.'], sort=False)['count percent'].max()
</code></pre>
<p>I get the output to be</p>
<pre><code>grpno.
1    14.78
2     0.00
3     8.80
4    59.00
6     0.00
5     0.00
Name: count percent, dtype: float64
</code></pre>
<p>But I need output to be a dataframe that has the column name modified as 'MaxOfcount percent' and 'grpno.' Can anyone help on this? Thanks</p>