-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
DEPR: is_all_dates #36697
DEPR: is_all_dates #36697
Conversation
…pr-is_all_dates
…pr-is_all_dates
…pr-is_all_dates
thanks! very nice |
.rolling(window=25, min_periods=minp) | ||
.apply(f, raw=raw) | ||
.shift(-12) | ||
.reindex(series.index) |
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.
Why is this case raising a warning?
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.
ping
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.
series.reindex(list(series.index) + s)
has an object-dtype Index that can be cast to DatetimeIndex
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.
@jbrockmendel Thanks for the follow-up.
Now, the user is not actively creating a Seriew with an object-dtype index themselves, but it is happening under the hood in the rolling apply.
So I am not sure the user should see this warning (and it's actually not a single warning, but a flood of warnings, one for each window ..). Or what is the recommended way in this case to get rid of the warning?
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.
could suppress it inside roll_apply?
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.
Possibly. The warning only shows with raw=False
, so I suppose this comes from creating a Series for each window. We might also be able to avoid the warning altogether (without the need to suppress it) by modifying the series construction to be explicit about the index dtype?
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.
IMO we should address this before the release
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.
I opened #38182 for this
This reverts commit 90a6135.
…to DatetimeIndex in the Series constructor (23598)" (#38679) * Revert "DEPR: is_all_dates (#36697)" This reverts commit 90a6135. * revert Deprecated casting an object-dtype index of ``datetime`` objects to :class:`.DatetimeIndex` in the :class:`Series` constructor (:issue:`23598`) only * Revert "BUG: record warnings related to DatetimeIndex (#37193)" This reverts commit 23c41bd. * remove assert_produces_warning added in TST/REF: collect tests by method, some misplaced #37354
…to DatetimeIndex in the Series constructor (23598)" (pandas-dev#38679) * Revert "DEPR: is_all_dates (pandas-dev#36697)" This reverts commit 90a6135. * revert Deprecated casting an object-dtype index of ``datetime`` objects to :class:`.DatetimeIndex` in the :class:`Series` constructor (:issue:`23598`) only * Revert "BUG: record warnings related to DatetimeIndex (pandas-dev#37193)" This reverts commit 23c41bd. * remove assert_produces_warning added in TST/REF: collect tests by method, some misplaced pandas-dev#37354
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff