DOC: fix flake8 issue in groupby.rst
Fixed flake8 issue in groupby.rst, see Issue #24178 for more info.

The following flake8 'errors' have been fixed:
- doc/source/groupby.rst:72:18: F821 undefined name 'obj'
- doc/source/groupby.rst:72:30: F821 undefined name 'key'
- doc/source/groupby.rst:73:18: F821 undefined name 'obj'
- doc/source/groupby.rst:73:30: F821 undefined name 'key'
- doc/source/groupby.rst:74:18: F821 undefined name 'obj'
- doc/source/groupby.rst:74:31: F821 undefined name 'key1'
- doc/source/groupby.rst:74:37: F821 undefined name 'key2'
- doc/source/groupby.rst:1306:42: F821 undefined name 'report_func'
- doc/source/groupby.rst:242:15: E225 missing whitespace around operator
- doc/source/groupby.rst:242:15: E999 SyntaxError: invalid syntax
- doc/source/groupby.rst:242:19: E225 missing whitespace around operator
