Skip to content

Commit e92b786

Browse files
mroeschkejreback
authored andcommitted
CLN: Index imports and 0.23.1 whatsnew (#21490)
1 parent bf1c3dc commit e92b786

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

doc/source/whatsnew/v0.23.1.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ Bug Fixes
9797

9898
**Data-type specific**
9999

100-
- Bug in :meth:`Series.str.replace()` where the method throws `TypeError` on Python 3.5.2 (:issue: `21078`)
101-
- Bug in :class:`Timedelta`: where passing a float with a unit would prematurely round the float precision (:issue: `14156`)
100+
- Bug in :meth:`Series.str.replace()` where the method throws `TypeError` on Python 3.5.2 (:issue:`21078`)
101+
- Bug in :class:`Timedelta` where passing a float with a unit would prematurely round the float precision (:issue:`14156`)
102102
- Bug in :func:`pandas.testing.assert_index_equal` which raised ``AssertionError`` incorrectly, when comparing two :class:`CategoricalIndex` objects with param ``check_categorical=False`` (:issue:`19776`)
103103

104104
**Sparse**
@@ -110,12 +110,12 @@ Bug Fixes
110110
- Bug in :meth:`Series.reset_index` where appropriate error was not raised with an invalid level name (:issue:`20925`)
111111
- Bug in :func:`interval_range` when ``start``/``periods`` or ``end``/``periods`` are specified with float ``start`` or ``end`` (:issue:`21161`)
112112
- Bug in :meth:`MultiIndex.set_names` where error raised for a ``MultiIndex`` with ``nlevels == 1`` (:issue:`21149`)
113-
- Bug in :class:`IntervalIndex` constructors where creating an ``IntervalIndex`` from categorical data was not fully supported (:issue:`21243`, issue:`21253`)
113+
- Bug in :class:`IntervalIndex` constructors where creating an ``IntervalIndex`` from categorical data was not fully supported (:issue:`21243`, :issue:`21253`)
114114
- Bug in :meth:`MultiIndex.sort_index` which was not guaranteed to sort correctly with ``level=1``; this was also causing data misalignment in particular :meth:`DataFrame.stack` operations (:issue:`20994`, :issue:`20945`, :issue:`21052`)
115115

116116
**Plotting**
117117

118-
- New keywords (sharex, sharey) to turn on/off sharing of x/y-axis by subplots generated with pandas.DataFrame().groupby().boxplot() (:issue: `20968`)
118+
- New keywords (sharex, sharey) to turn on/off sharing of x/y-axis by subplots generated with pandas.DataFrame().groupby().boxplot() (:issue:`20968`)
119119

120120
**I/O**
121121

pandas/core/indexes/base.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def __new__(cls, data=None, dtype=None, copy=False, name=None,
283283
if (is_datetime64_any_dtype(data) or
284284
(dtype is not None and is_datetime64_any_dtype(dtype)) or
285285
'tz' in kwargs):
286-
from pandas.core.indexes.datetimes import DatetimeIndex
286+
from pandas import DatetimeIndex
287287
result = DatetimeIndex(data, copy=copy, name=name,
288288
dtype=dtype, **kwargs)
289289
if dtype is not None and is_dtype_equal(_o_dtype, dtype):
@@ -293,7 +293,7 @@ def __new__(cls, data=None, dtype=None, copy=False, name=None,
293293

294294
elif (is_timedelta64_dtype(data) or
295295
(dtype is not None and is_timedelta64_dtype(dtype))):
296-
from pandas.core.indexes.timedeltas import TimedeltaIndex
296+
from pandas import TimedeltaIndex
297297
result = TimedeltaIndex(data, copy=copy, name=name, **kwargs)
298298
if dtype is not None and _o_dtype == dtype:
299299
return Index(result.to_pytimedelta(), dtype=_o_dtype)
@@ -404,17 +404,15 @@ def __new__(cls, data=None, dtype=None, copy=False, name=None,
404404
if (lib.is_datetime_with_singletz_array(subarr) or
405405
'tz' in kwargs):
406406
# only when subarr has the same tz
407-
from pandas.core.indexes.datetimes import (
408-
DatetimeIndex)
407+
from pandas import DatetimeIndex
409408
try:
410409
return DatetimeIndex(subarr, copy=copy,
411410
name=name, **kwargs)
412411
except libts.OutOfBoundsDatetime:
413412
pass
414413

415414
elif inferred.startswith('timedelta'):
416-
from pandas.core.indexes.timedeltas import (
417-
TimedeltaIndex)
415+
from pandas import TimedeltaIndex
418416
return TimedeltaIndex(subarr, copy=copy, name=name,
419417
**kwargs)
420418
elif inferred == 'period':
@@ -1177,7 +1175,7 @@ def astype(self, dtype, copy=True):
11771175
copy=copy)
11781176
try:
11791177
if is_datetime64tz_dtype(dtype):
1180-
from pandas.core.indexes.datetimes import DatetimeIndex
1178+
from pandas import DatetimeIndex
11811179
return DatetimeIndex(self.values, name=self.name, dtype=dtype,
11821180
copy=copy)
11831181
return Index(self.values.astype(dtype, copy=copy), name=self.name,
@@ -3333,7 +3331,7 @@ def get_indexer_for(self, target, **kwargs):
33333331

33343332
def _maybe_promote(self, other):
33353333
# A hack, but it works
3336-
from pandas.core.indexes.datetimes import DatetimeIndex
3334+
from pandas import DatetimeIndex
33373335
if self.inferred_type == 'date' and isinstance(other, DatetimeIndex):
33383336
return DatetimeIndex(self), other
33393337
elif self.inferred_type == 'boolean':

0 commit comments

Comments
 (0)