Skip to content

Commit 8ff02ef

Browse files
committed
initial fixes
1 parent 5b90ae3 commit 8ff02ef

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/core/indexes/interval.py

+4-4
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
@@ -240,7 +240,8 @@ def _simple_new(cls, left, right, closed=None, name=None,
240240
elif isinstance(left, ABCPeriodIndex):
241241
msg = 'Period dtypes are not supported, use a PeriodIndex instead'
242242
raise ValueError(msg)
243-
elif isinstance(left, ABCDatetimeIndex) and left.tz != right.tz:
243+
elif (isinstance(left, ABCDatetimeIndex) and
244+
str(left.tz) != str(right.tz)):
244245
msg = ("left and right must have the same time zone, got "
245246
"'{left_tz}' and '{right_tz}'")
246247
raise ValueError(msg.format(left_tz=left.tz, right_tz=right.tz))
@@ -646,7 +647,6 @@ def mid(self):
646647
except TypeError:
647648
# datetime safe version
648649
tz = self.right.tz
649-
freq = self.right.freq
650650
delta = self.right.values - self.left.values
651651

652652
# handle tz aware
@@ -656,7 +656,7 @@ def mid(self):
656656
else:
657657
data = self.left + 0.5 * delta
658658

659-
return DatetimeIndex(data, freq=freq, tz=tz)
659+
return data
660660

661661
@cache_readonly
662662
def is_monotonic(self):

0 commit comments

Comments
 (0)