8000 BUG: Issues with DatetimeTZ values in where and combine_first (#21469 + #21546) by Liam3851 · Pull Request #21660 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: Issues with DatetimeTZ values in where and combine_first (#21469 + #21546) #21660

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

Merged
merged 14 commits into from
Jul 2, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove orphaned private _where_compat method.
  • Loading branch information
Liam3851 committed Jun 27, 2018
commit 8c022d96e1a7f8308b246c2b8159cdb51b66c79f
13 changes: 0 additions & 13 deletions pandas/core/common.py
4387
Original file line number Diff line number Diff line change
Expand Up @@ -410,19 +410,6 @@ def _apply_if_callable(maybe_callable, obj, **kwargs):
return maybe_callable


def _where_compat(mask, arr1, arr2):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

if arr1.dtype == _NS_DTYPE and arr2.dtype == _NS_DTYPE:
new_vals = np.where(mask, arr1.view('i8'), arr2.view('i8'))
return new_vals.view(_NS_DTYPE)

if arr1.dtype == _NS_DTYPE:
arr1 = tslib.ints_to_pydatetime(arr1.view('i8'))
if arr2.dtype == _NS_DTYPE:
arr2 = tslib.ints_to_pydatetime(arr2.view('i8'))

return np.where(mask, arr1, arr2)


def _dict_compat(d):
"""
Helper function to convert datetimelike-keyed dicts to Timestamp-keyed dict
Expand Down
0