BUG: Fix groupby nth with axis=1
Fixes a bug that no one has reported and probably no one cares about. But overlaps slightly with #42947, so I thought that I would make it a separate PR.

Current behaviour: `df.groupby(df.iloc[1], axis=1).nth(0)` crashes ungracefully.
Hello @johnzangwill! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:





There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2021-10-13 07:59:55 UTC > also pls add a whatsnew note for 1.4, groupby bug fix section

Done @jreback all green apart from `Python Dev / actions-310-dev (macOS-latest) (pull_request)` 60 minute timeout > small nit, pls merge master and ping on green

Still all green apart from another quite frequent ci testing failure:

```
>           raise AssertionError(f"Caused unexpected warning(s): {repr(extra_warnings)}")
E           AssertionError: Caused unexpected warning(s): [('ResourceWarning', ResourceWarning('unclosed file <_io.BufferedRandom name=13>'), '/home/runner/work/pandas/pandas/pandas/io/formats/excel.py', 179)]
```

Which I am sure is nothing to do with my code... thanks @johnzangwill very nice