Skip to content

Commit 070873d

Browse files
committed
initial fixes
1 parent 3af3aa4 commit 070873d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/core/indexes/interval.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
Interval, IntervalMixin, IntervalTree,
3030
intervals_to_interval_bounds)
3131

32-
from pandas.core.indexes.datetimes import DatetimeIndex, date_range
32+
from pandas.core.indexes.datetimes import date_range
3333
from pandas.core.indexes.timedeltas import timedelta_range
3434
from pandas.core.indexes.multi import MultiIndex
3535
from pandas.compat.numpy import function as nv
@@ -239,7 +239,8 @@ def _simple_new(cls, left, right, closed=None, name=None,
239239
elif isinstance(left, ABCPeriodIndex):
240240
msg = 'Period dtypes are not supported, use a PeriodIndex instead'
241241
raise ValueError(msg)
242-
elif isinstance(left, ABCDatetimeIndex) and left.tz != right.tz:
242+
elif (isinstance(left, ABCDatetimeIndex) and
243+
str(left.tz) != str(right.tz)):
243244
msg = ("left and right must have the same time zone, got "
244245
"'{left_tz}' and '{right_tz}'")
245246
raise ValueError(msg.format(left_tz=left.tz, right_tz=right.tz))
@@ -663,7 +664,6 @@ def mid(self):
663664
except TypeError:
664665
# datetime safe version
665666
tz = self.right.tz
666-
freq = self.right.freq
667667
delta = self.right.values - self.left.values
668668

669669
# handle tz aware
@@ -673,7 +673,7 @@ def mid(self):
673673
else:
674674
data = self.left + 0.5 * delta
675675

676-
return DatetimeIndex(data, freq=freq, tz=tz)
676+
return data
677677

678678
@cache_readonly
679679
def is_monotonic(self):

0 commit comments

Comments
 (0)