Skip to content

DOC: DatetimeArray.std #44020

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

Merged
merged 3 commits into from
Oct 18, 2021
Merged

DOC: DatetimeArray.std #44020

merged 3 commits into from
Oct 18, 2021

Conversation

twoertwein
Copy link
Member

DatetimeIndex.std is missing a doc-string. Add doc-string to DatetimeArray.std as DatetimeIndex is re-using DatetimeArray.std.

There are a few more keywords, but they seem to be not implemented (numpy-compatiblity?)

pd.DatetimeIndex([1, 2]).std(out=[])
ValueError: the 'out' parameter is not supported in the pandas implementation of std()

pd.DatetimeIndex([1, 2]).std(keepdims=True)
ValueError: the 'keepdims' parameter is not supported in the pandas implementation of std()

pd.DatetimeIndex([1, 2]).std(dtype=np.dtype("datetime64[ns]"))
ValueError: the 'dtype' parameter is not supported in the pandas implementation of std()

For some reason, this doc-string is needed for #43828.


Parameters
----------
axis : optional, default None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int optional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

Is there a policy how to annotate None? I have seen different ways:
SomeType or None, default None
SomeType, optional

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a policy how to annotate None?

not really

@twoertwein
Copy link
Member Author

twoertwein commented Oct 14, 2021

Getting

/home/runner/work/pandas/pandas/pandas/core/indexes/datetimes.py:docstring of pandas.core.indexes.datetimes.DatetimeIndex:124: WARNING: autosummary: stub file not found 'pandas.DatetimeIndex.std'. Check your autosummary_generate setting.

even though pd.core.indexes.datetimes.DatetimeIndex([1]).std.__doc__ returns the doc-string.

edit: Running python doc/make.py --single "pandas.DatetimeIndex.std" --num-jobs 1 also picks up on the doc-string.

@alimcmaster1 alimcmaster1 added this to the 1.4 milestone Oct 16, 2021
@jbrockmendel
Copy link
Member

I think it wants an 'std' entry in doc/source/reference/indexing.rst DatetimeIndex.std

@twoertwein
Copy link
Member Author

I think it wants an 'std' entry in doc/source/reference/indexing.rst DatetimeIndex.std

Thank you @jbrockmendel , now it seems to be happy :)

@jreback jreback merged commit f5c2242 into pandas-dev:master Oct 18, 2021
@twoertwein twoertwein deleted the doc branch April 1, 2022 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants