Skip to content

Timedelta index 29236 #29257

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 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pandas/core/arrays/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -1457,15 +1457,16 @@ def mean(self, skipna=True):
Parameters
----------
skipna : bool, default True
Whether to ignore any NaT elements
Whether to ignore any NaT elements.

Returns
-------
scalar (Timestamp or Timedelta)
scalar
Timestamp or Timedelta.

See Also
--------
numpy.ndarray.mean
numpy.ndarray.mean : Returns the average of array elements along a given axis.
Series.mean : Return the mean value in a Series.

Notes
Expand Down
14 changes: 8 additions & 6 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1169,20 +1169,22 @@ def to_flat_index(self):

def to_series(self, index=None, name=None):
"""
Create a Series with both index and values equal to the index keys
useful with map for returning an indexer based on an index.
Create a Series with both index and values equal to the index keys.

Useful with map for returning an indexer based on an index.

Parameters
----------
index : Index, optional
index of resulting Series. If None, defaults to original index
Index of resulting Series. If None, defaults to original index.
name : str, optional
name of resulting Series. If None, defaults to name of original
index
Dame of resulting Series. If None, defaults to name of original
index.

Returns
-------
Series : dtype will be based on the type of the Index values.
Series
The dtype will be based on the type of the Index values.
"""

from pandas import Series
Expand Down