Groupby agg works with pd.Series.nunique, but groupby nunique fails with axis=1
- [x] closes #30253
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

PR has been updated accordingly to your remarks Great thanks @nlepleux ! What performance are you looking for from the axis=1 case? Wonder if time is better spent optimizing that than reverting

Sent from my iPhone

> On Dec 18, 2019, at 4:17 PM, Jeff Reback <notifications@github.com> wrote:
> 
> ﻿
> @jreback commented on this pull request.
> 
> In pandas/core/groupby/generic.py:
> 
> > @@ -1813,9 +1813,20 @@ def groupby_series(obj, col=None):
>              # Try to consolidate with normal wrapping functions
>              from pandas.core.reshape.concat import concat
>  
> -            results = [groupby_series(content, label) for label, content in obj.items()]
> +            axis_number = obj._get_axis_number(self.axis)
> @WillAyd this is adding quite a bit of very hard and bespoke code
> 
> pls don’t merge non trivial things like this
> 
> this is also likely non performant
> 
> pls revert
> 
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub, or unsubscribe.
 i am way more concerned about the code smell this introduces
w/o much review 