-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
DOC: update the pandas.Series.dt.is_year_end docstring #20274
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
Changes from 2 commits
a0bda5b
d10bb37
44b6fe6
897428c
61aedbc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1747,7 +1747,33 @@ def freq(self, value): | |
| is_year_end = _field_accessor( | ||
| 'is_year_end', | ||
| 'is_year_end', | ||
| "Logical indicating if last day of year (defined by frequency)") | ||
| """ | ||
| Return a boolean indicating whether the date is the last day of the | ||
| year. | ||
|
|
||
| Returns | ||
| ------- | ||
| is_year_end : Series of boolean. | ||
|
||
|
|
||
| See Also | ||
| -------- | ||
| is_year_start : Return a boolean indicating whether the date is the | ||
|
||
| first day of the year. | ||
|
|
||
| Examples | ||
| -------- | ||
| >>> dates = pd.Series(pd.date_range("2017-12-30", periods=3)) | ||
| >>> dates | ||
| 0 2017-12-30 | ||
| 1 2017-12-31 | ||
| 2 2018-01-01 | ||
| dtype: datetime64[ns] | ||
| >>> dates.dt.is_year_end | ||
| 0 False | ||
| 1 True | ||
| 2 False | ||
| dtype: bool | ||
| """) | ||
|
Contributor
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. Could you add an example with just a DatetimeIndex? Can be the same values, and don't have to show the values again, and show the output |
||
| is_leap_year = _field_accessor( | ||
| 'is_leap_year', | ||
| 'is_leap_year', | ||
|
|
||
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.
This should be a single line. Does
fit on a single line?
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.
Boolean array is not correct in case of Series ...
(but I agree that just "boolean" does not reflect is returns a boolean for each element)
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.
Perhaps just
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.
Yes, that's better. Or maybe even shorter "Indicate whether ..." instead of "Return an indicator whether .." ?