BUG: idxmax/min (and argmax/min) for Series with underlying ExtensionArray
- [x] closes #32749, closes #33719, closes #36566
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

Currently `pd.Series([1, 2, 3]).astype('Int8').idxmax()` raises an error.
This request proposes a fix.
My first time using Github and opening a pull request. Apologise if it's no good.
Hello @tonyyyyip! 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 2020-12-31 01:56:35 UTC Thanks @arw2019!

This should solve #33719.  Currently the code sample raises `TypeError: argmax() takes 1 positional argument but 2 were given`. This is because the implementation of argmax/min of ExtensionArray takes only 1 argument `self` but the "interface" passes an additional argument `None` to it.

Added test. Not sure if I have done right though. Thanks again.  You also wanna look at the CI checks (in my experience easiest thing is to use the pre-commit tool locally) Thanks @arw2019. I am completely new to testing. I will check that out. This is possibly also related to https://github.com/pandas-dev/pandas/issues/35178 (although that speaks about argmin/argmax, and not idxmin/idxmax) > This is possibly also related to #35178 (although that speaks about argmin/argmax, and not idxmin/idxmax)

Yes both the `argmax` and `idxmax` Series methods call the `argmax` method of the underlying `_values` with the additional argument `None`  (for the axis), which is normally fine when the `_values` is an nparray, but breaks when it's an EA, because the current EA implementation of `argmax` does not take any additional arguments. This PR fixes that. > > This is possibly also related to #35178 (although that speaks about argmin/argmax, and not idxmin/idxmax)
> 
> Yes both the `argmax` and `idxmax` Series methods call the `argmax` method of the underlying `_values` with the additional argument `None` (for the axis), which is normally fine when the `_values` is an nparray, but breaks when it's an EA, because the current EA implementation of `argmax` does not take any additional arguments. This PR fixes that.

Can you add tests for argmax/argmin so we can decide if this resolves  #35178 (if yes great!) Gentle ping to see if this is going anywhere.

Please let me know if my changes are not what what the requests wanted, as I might have misunderstood the requests.

Also I understand it was decided that argmax and idxmax should be separated because argmax is likely understated. I am happy to follow that philosophy here. @jreback Added whatsnew entry and referenced issues. Thanks. thanks @tonyyyyip very nice > thanks @tonyyyyip very nice

Thanks.