10000 ENH: Support TZ Aware IntervalIndex by jschendel · Pull Request #18558 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

ENH: Support TZ Aware IntervalIndex #18558

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 3 commits into from
Dec 8, 2017
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
fix mid computation after bug fix
  • Loading branch information
jschendel committed Dec 7, 2017
commit 79e255c3c2a4ad27fdc41f84d8fda0c71a963fc2
13 changes: 2 additions & 11 deletions pandas/core/indexes/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,17 +663,8 @@ def mid(self):
return Index(0.5 * (self.left.values + self.right.values))
except TypeError:
# datetime safe version
tz = self.right.tz
delta = self.right.values - self.left.values

# handle tz aware
if tz:
data = self.left.tz_localize(None) + 0.5 * delta
data = data.tz_localize(tz)
else:
data = self.left + 0.5 * delta

return data
delta = self.right - self.left
return self.left + 0.5 * delta

@cache_readonly
def is_monotonic(self):
Expand Down
0