-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOCS: fix docstring validation error for pandas.Series #59655
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
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
561ae13
DOCS: fix docstring validation error for pandas.Series
githubalexliu d89a187
Merge branch 'main' into fix_docstring_2
githubalexliu e12308c
Added *args and **kwargs parameter for normalize
githubalexliu 8ef0b96
DOCS: Added period for DatetimeIndex.quarter
githubalexliu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -250,6 +250,7 @@ def _scalar_type(self) -> type[Timestamp]: | |||||
"dayofyear", | ||||||
"day_of_year", | ||||||
"quarter", | ||||||
"qyear", | ||||||
"days_in_month", | ||||||
"daysinmonth", | ||||||
"microsecond", | ||||||
|
@@ -1141,7 +1142,7 @@ def to_pydatetime(self) -> npt.NDArray[np.object_]: | |||||
""" | ||||||
return ints_to_pydatetime(self.asi8, tz=self.tz, reso=self._creso) | ||||||
|
||||||
def normalize(self) -> Self: | ||||||
def normalize(self, *args, **kwargs) -> Self: | ||||||
""" | ||||||
Convert times to midnight. | ||||||
|
||||||
|
@@ -1152,6 +1153,15 @@ def normalize(self) -> Self: | |||||
This method is available on Series with datetime values under | ||||||
the ``.dt`` accessor, and directly on Datetime Array/Index. | ||||||
|
||||||
Parameters | ||||||
---------- | ||||||
*args : any, default None | ||||||
Additional keywords have no effect but might be accepted for | ||||||
compatibility with NumPy. | ||||||
**kwargs : any, default None | ||||||
Additional keywords have no effect but might be accepted for | ||||||
compatibility with NumPy. | ||||||
|
||||||
Returns | ||||||
------- | ||||||
DatetimeArray, DatetimeIndex or Series | ||||||
|
@@ -1919,6 +1929,50 @@ def isocalendar(self) -> DataFrame: | |||||
Index([1, 1], dtype='int32') | ||||||
""", | ||||||
) | ||||||
qyear = _field_accessor( | ||||||
"qyear", | ||||||
"qy", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
"qy" is not a valid field. |
||||||
""" | ||||||
Fiscal year the Period lies in according to its starting-quarter. | ||||||
|
||||||
The `year` and the `qyear` of the period will be the same if the fiscal | ||||||
and calendar years are the same. When they are not, the fiscal year | ||||||
can be different from the calendar year of the period. | ||||||
|
||||||
Returns | ||||||
------- | ||||||
int | ||||||
The fiscal year of the period. | ||||||
|
||||||
See Also | ||||||
-------- | ||||||
DatetimeIndex.year : Return the calendar year of the date. | ||||||
DatetimeIndex.quarter : Return the quarter of the date. | ||||||
|
||||||
Examples | ||||||
-------- | ||||||
If the natural and fiscal year are the same, `qyear` and `year` will | ||||||
be the same. | ||||||
|
||||||
>>> per = pd.Period('2018Q1', freq='Q') | ||||||
>>> per.qyear | ||||||
2018 | ||||||
>>> per.year | ||||||
2018 | ||||||
|
||||||
If the fiscal year starts in April (`Q-MAR`), the first quarter of | ||||||
2018 will start in April 2017. `year` will then be 2017, but `qyear` | ||||||
will be the fiscal year, 2018. | ||||||
|
||||||
>>> per = pd.Period('2018Q1', freq='Q-MAR') | ||||||
>>> per.start_time | ||||||
Timestamp('2017-04-01 00:00:00') | ||||||
>>> per.qyear | ||||||
2018 | ||||||
>>> per.year | ||||||
2017 | ||||||
""", | ||||||
) | ||||||
days_in_month = _field_accessor( | ||||||
"days_in_month", | ||||||
"dim", | ||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no
normalize
numpy function as far as I know so this should not be included