-
- Notifications
You must be signed in to change notification settings - Fork 19.4k
Open
Labels
DocsNeeds TriageIssue that has not been reviewed by a pandas team memberIssue that has not been reviewed by a pandas team member
Description
Pandas version checks
- I have checked that the issue still exists on the latest versions of the docs on
mainhere
Location of the documentation
https://pandas.pydata.org/docs/reference/api/pandas.DatetimeIndex.quarter.html
Documentation problem
source link for DatetimeIndex.quarter directs to incorrect code
https://github.com/pandas-dev/pandas/blob/v2.2.2/pandas/core/indexes/extension.py#L67-L75
Suggested fix for documentation
replace with the following link
pandas/pandas/core/arrays/datetimes.py
Lines 1817 to 1845 in 4afc277
| quarter = _field_accessor( | |
| "quarter", | |
| "q", | |
| """ | |
| The quarter of the date. | |
| Examples | |
| -------- | |
| For Series: | |
| >>> s = pd.Series(["1/1/2020 10:00:00+00:00", "4/1/2020 11:00:00+00:00"]) | |
| >>> s = pd.to_datetime(s) | |
| >>> s | |
| 0 2020-01-01 10:00:00+00:00 | |
| 1 2020-04-01 11:00:00+00:00 | |
| dtype: datetime64[ns, UTC] | |
| >>> s.dt.quarter | |
| 0 1 | |
| 1 2 | |
| dtype: int32 | |
| For DatetimeIndex: | |
| >>> idx = pd.DatetimeIndex(["1/1/2020 10:00:00+00:00", | |
| ... "2/1/2020 11:00:00+00:00"]) | |
| >>> idx.quarter | |
| Index([1, 1], dtype='int32') | |
| """, | |
| ) |
Metadata
Metadata
Assignees
Labels
DocsNeeds TriageIssue that has not been reviewed by a pandas team memberIssue that has not been reviewed by a pandas team member