Changed to GroupBy
- [ ] closes #59695  (Replace xxxx with the GitHub issue number)
 I have tried changing the groupby to GroupBy. Please check the hyperlink if it works.

On it  Hey @mroeschke , I made the necessary changes. Could you please check and merge the PR . I really would like to contribute to such amazing projects like pandas. Thanks @doshi-kevin 