Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dataframe.median and Dataframe.mean documentation #19892

Open
Aamir-Raza opened this issue Feb 25, 2018 · 1 comment
Open

Dataframe.median and Dataframe.mean documentation #19892

Aamir-Raza opened this issue Feb 25, 2018 · 1 comment
Labels
Docs Reduction Operations sum, mean, min, max, etc.

Comments

@Aamir-Raza
Copy link

https://pandas-docs.github.io/pandas-docs-travis/generated/pandas.DataFrame.median.html?highlight=dataframe%20median#pandas.DataFrame.median

DataFrame.median(axis=None, skipna=None, level=None, numeric_only=None, **kwargs)

Issue:

skipna shows as None in the code above but in the parameters it says 'skipna : boolean, default True'. So should it say True in the line above? Maybe I'm wrong, feel free to correct me!

Same for dataframe.mean:
https://pandas-docs.github.io/pandas-docs-travis/generated/pandas.DataFrame.mean.html?highlight=dataframe%20mean#pandas.DataFrame.mean

@jorisvandenbossche
Copy link
Member

Thanks for reporting. This is due to the actual code implementation, but I agree we should always try to get it render correctly in the docs.

In this case, I am not fully sure the None in the code is actually needed:

pandas/pandas/core/generic.py

Lines 7903 to 7907 in 8f1dfa7

def stat_func(self, axis=None, skipna=None, level=None, numeric_only=None,
**kwargs):
nv.validate_stat_func(tuple(), kwargs, fname=name)
if skipna is None:
skipna = True

@jreback any idea why the default is not just skipna=True. I don't see a reason in this snippet to have the default None and only later set it (it's not that we do something with the fact it being None, like for eg a deprecation).

@jbrockmendel jbrockmendel added the Numeric Operations Arithmetic, Comparison, and Logical operations label Sep 21, 2020
@jbrockmendel jbrockmendel added the Reduction Operations sum, mean, min, max, etc. label Oct 27, 2020
@jorisvandenbossche jorisvandenbossche removed the Numeric Operations Arithmetic, Comparison, and Logical operations label Apr 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Reduction Operations sum, mean, min, max, etc.
Projects
None yet
Development

No branches or pull requests

3 participants