DOC: Updated aggregate docstring
State: closed

Link to current `Series.agg`: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.agg.html

Original question asked in gitter:
Does `pd.Series.agg` with `func` parameter set to `'median'` uses `np.nanmedian`(Not only `median` including `mean`, `mode`)?
```python
s= pd.Series([np.nan, np.nan,1,1,1])
s.agg('median') 
# 1
s.agg(np.median)
# 1
np.median(s.to_numpy())
# nan
np.nanmedian(s.to_numpy())
# 1
```
Whenever `NaN` is present does it fallback to using `np.nanmedian`?

---

Reply from @MarcoGorelli 
if you look at `pandas/core/base.py` you'll see
```
    np.median: "median",
    np.nanmedian: "median",
```
in `_cython_table`. So, both resolve to the same internal cython function.

---

IMO it's better to mention this in the docs under `Note:` section.

Under note section saying:
*Some NumPy functions such as `np.mean`, `np.nanmean`, `np.median` etc. resolve to their corresponding internal cython function.*


#### Output of `python validate_docstrings.py pandas.Series.agg`
<details>

```
################################################################################
######################## Docstring (pandas.Series.agg)  ########################
################################################################################

Aggregate using one or more operations over the specified axis.

.. versionadded:: 0.20.0

Parameters
----------
func : function, str, list or dict
    Function to use for aggregating the data. If a function, must either
    work when passed a Series or when passed to Series.apply.

    Accepted combinations are:

    - function
    - string function name
    - list of functions and/or function names, e.g. ``[np.sum, 'mean']``
    - dict of axis labels -> functions, function names or list of such.
axis : {0 or 'index'}
        Parameter needed for compatibility with DataFrame.
*args
    Positional arguments to pass to `func`.
**kwargs
    Keyword arguments to pass to `func`.

Returns
-------
scalar, Series or DataFrame

    The return can be:

    * scalar : when Series.agg is called with single function
    * Series : when DataFrame.agg is called with a single function
    * DataFrame : when DataFrame.agg is called with several functions

    Return scalar, Series or DataFrame.

See Also
--------
Series.apply : Invoke function on a Series.
Series.transform : Transform function producing a Series with like indexes.

Notes
-----
`agg` is an alias for `aggregate`. Use the alias.
Some NumPy functions such as `np.mean`, `np.nanmean`, `np.median` etc.
resolve to their corresponding internal cython function.

A passed user-defined-function will be passed a Series for evaluation.

Examples
--------
>>> s = pd.Series([1, 2, 3, 4])
>>> s
0    1
1    2
2    3
3    4
dtype: int64

>>> s.agg('min')
1

>>> s.agg(['min', 'max'])
min   1
max   4
dtype: int64

################################################################################
################################## Validation ##################################
################################################################################

Docstring for "pandas.Series.agg" correct. :)
```
</details>

Labels:
name: Docs

Comments:
Hello @gurukiran07! 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-08-24 13:26:17 UTC
@gurukiran07 why did you close this, and why do you say "I guess this is fixed now"?
@MarcoGorelli 
```
The aggregation operations are always performed over an axis, either the
index (default) or the column axis. This behavior is different from
numpy aggregation functions (mean, median, prod, sum, std,
var), where the default is to compute the aggregation of the flattened
array, e.g., numpy.mean(arr_2d) as opposed to
numpy.mean(arr_2d, axis=0).
```
This was mentioned in the docs. I thought this would cover `NaNs` part, but this doesn't look like it. Reopening the PR. 
@datapythonista  @MarcoGorelli It's green now, all tests passed. If there are any changes to be made let me know.


> Thanks @gurukiran07, looks good to me.

@datapythonista Guess, I need to retrigger the checks. Will ping once green.
@datapythonista All checks passed, it's green now.
Cool, merging then following Marc's approval, thanks @gurukiran07