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

DOC: Incorrect Source Link #58350

Open
1 task done
gboeker opened this issue Apr 21, 2024 · 3 comments
Open
1 task done

DOC: Incorrect Source Link #58350

gboeker opened this issue Apr 21, 2024 · 3 comments
Labels
Docs Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@gboeker
Copy link
Contributor

gboeker commented Apr 21, 2024

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

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

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')
""",
)

@gboeker gboeker added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 21, 2024
@KeiOshima
Copy link
Contributor

i've seen similar issues in pandas.DatetimeIndex.month and pandas.DatetimeIndex.year

@gboeker
Copy link
Contributor Author

gboeker commented Apr 21, 2024

@gboeker
Copy link
Contributor Author

gboeker commented Apr 21, 2024

I would love to work on this issue if it looks correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

No branches or pull requests

2 participants