Skip to content

DOC: mean param missing in ndarray.{std,var} docstring signatures #29384

@jorenham

Description

@jorenham

Issue with current documentation:

The ndarray.std and ndarray.var docstrings do not include the mean kwarg:

>>> import numpy as np
>>> np.__version__
'2.3.1'
>>> print(np.ndarray.std.__doc__)
a.std(axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True)

    Returns the standard deviation of the array elements along given axis.

    Refer to `numpy.std` for full documentation.

    See Also
    --------
    numpy.std : equivalent function

But as it turns out, it's actually a thing:

>>> np.array([1, 2]).std()
np.float64(0.5)
>>> np.array([1, 2]).std(mean=1)
np.float64(0.7071067811865476)

And even though I like this esoteric/peekaboo vibe, I suppose that correct docstrings can also be nice to have.

Idea or request for content:

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions