-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Add more documentation showcasing CalendarDay #22633
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #22633 +/- ##
=======================================
Coverage 92.16% 92.16%
=======================================
Files 169 169
Lines 50708 50708
=======================================
Hits 46734 46734
Misses 3974 3974
Continue to review full report at Codecov.
|
idx = pd.date_range("2016-10-30", freq='H', periods=4*24, tz='Europe/Helsinki') | ||
s = pd.Series(range(len(idx)), index=idx) | ||
s.resample('D').count() | ||
s.resample('CD').count() |
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.
Is this supposed to work on master? After a clean build locally I get a ValueError: Invalid frequency: CD
.
Don't think doctest covers these files; if it does then my mistake but figured it was worth asking
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 currently works on master:
In [3]: pd.__version__
Out[3]: '0.24.0.dev0+563.g0976e1261'
In [4]: idx = pd.date_range("2016-10-30", freq='H', periods=4*24, tz='Europe/
...: Helsinki')
...: s = pd.Series(range(len(idx)), index=idx)
...: s.resample('D').count()
...: s.resample('CD').count()
...:
...:
Out[4]:
2016-10-30 00:00:00+03:00 25
2016-10-31 00:00:00+02:00 24
2016-11-01 00:00:00+02:00 24
2016-11-02 00:00:00+02:00 23
Freq: CD, dtype: int64
I am not sure if the doctest uses master or the the latest tagged branch.
@@ -317,14 +317,34 @@ and respect calendar day arithmetic while :class:`Day` and frequency alias ``'D' | |||
will now respect absolute time (:issue:`22274`, :issue:`20596`, :issue:`16980`, :issue:`8774`) | |||
See the :ref:`documentation here <timeseries.dayvscalendarday>` for more information. | |||
|
|||
Addition with :class:`CalendarDay` across a daylight savings time transition: | |||
The difference between :class:`Day` vs :class:`CalendarDay` is most apparent | |||
with timezone-aware datetime data with a daylight savings time transition: |
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.
You say "most apparent with timezone-aware data". But is there a case where this is actually relevant for tz naive data?
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 difference between Day
and CalendarDay
for tz naive data. I've parameterized some tz naive data tests for 'D'
and 'CD'
to ensure this behavior.
Hello @mroeschke! Thanks for updating the PR.
|
Closing as we're not moving forward with "CD" |
xref #22288 (comment)
Highlighting usages of
CalendarDay
withdate_range
andresample
specifically.