-
-
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
Changes from all commits
c580fc3
f131230
3da2c7d
f0761c3
3b8c102
12b4694
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 |
---|---|---|
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. There is no difference between |
||
|
||
Addition with :class:`CalendarDay`: | ||
|
||
.. ipython:: python | ||
|
||
ts = pd.Timestamp('2016-10-30 00:00:00', tz='Europe/Helsinki') | ||
ts + pd.offsets.Day(1) | ||
ts + pd.offsets.CalendarDay(1) | ||
|
||
Creating a :func:`date_range`: | ||
|
||
.. ipython:: python | ||
|
||
start = pd.Timestamp('2016-10-30 00:00:00', tz='Europe/Helsinki') | ||
pd.date_range(start, freq='D', periods=3) | ||
pd.date_range(start, freq='CD', periods=3) | ||
|
||
Resampling a timeseries: | ||
|
||
.. ipython:: python | ||
|
||
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() | ||
|
||
.. _whatsnew_0240.api_breaking.period_end_time: | ||
|
||
Time values in ``dt.end_time`` and ``to_timestamp(how='end')`` | ||
|
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:
I am not sure if the doctest uses master or the the latest tagged branch.