Skip to content

Commit 269289c

Browse files
define instance at top level
1 parent fdb9f5c commit 269289c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pandas/core/api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
)
6868
from pandas.core.indexes.period import period_range
6969
from pandas.core.indexes.timedeltas import timedelta_range
70-
from pandas.core.indexing import IndexSlice
70+
from pandas.core.indexing import IndexSlice as _IndexSlice
7171
from pandas.core.series import Series
7272
from pandas.core.tools.datetimes import to_datetime
7373
from pandas.core.tools.numeric import to_numeric
@@ -79,6 +79,8 @@
7979
# DataFrame needs to be imported after NamedAgg to avoid a circular import
8080
from pandas.core.frame import DataFrame # isort:skip
8181

82+
IndexSlice = _IndexSlice()
83+
8284
__all__ = [
8385
"array",
8486
"ArrowDtype",

pandas/core/indexing.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102

103103
# the public IndexSlicerMaker
104104
@set_module("pandas")
105-
class _IndexSlice:
105+
class IndexSlice:
106106
"""
107107
Create an object to more easily perform multi-index slicing.
108108
@@ -149,8 +149,6 @@ def __getitem__(self, arg):
149149
return arg
150150

151151

152-
IndexSlice = _IndexSlice()
153-
154152

155153
class IndexingMixin:
156154
"""

0 commit comments

Comments
 (0)