2323from pandas .core .common import (is_bool_indexer , _asarray_tuplesafe ,
2424 is_null_slice , is_full_slice ,
2525 _values_from_object )
26+ from pandas ._libs .indexing import _NDFrameIndexerBase
2627
2728
2829# the supported indexers
@@ -85,19 +86,14 @@ class IndexingError(Exception):
8586 pass
8687
8788
88- class _NDFrameIndexer (object ):
89+ class _NDFrameIndexer (_NDFrameIndexerBase ):
8990 _valid_types = None
9091 _exception = KeyError
9192 axis = None
9293
93- def __init__ (self , obj , name ):
94- self .obj = obj
95- self .ndim = obj .ndim
96- self .name = name
97-
9894 def __call__ (self , axis = None ):
9995 # we need to return a copy of ourselves
100- new_self = self .__class__ (self .obj , self .name )
96+ new_self = self .__class__ (self .name , self .obj )
10197
10298 if axis is not None :
10399 axis = self .obj ._get_axis_number (axis )
@@ -1321,7 +1317,7 @@ class _IXIndexer(_NDFrameIndexer):
13211317
13221318 """
13231319
1324- def __init__ (self , obj , name ):
1320+ def __init__ (self , name , obj ):
13251321
13261322 _ix_deprecation_warning = textwrap .dedent ("""
13271323 .ix is deprecated. Please use
@@ -1332,8 +1328,8 @@ def __init__(self, obj, name):
13321328 http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated""" ) # noqa
13331329
13341330 warnings .warn (_ix_deprecation_warning ,
1335- DeprecationWarning , stacklevel = 3 )
1336- super (_IXIndexer , self ).__init__ (obj , name )
1331+ DeprecationWarning , stacklevel = 2 )
1332+ super (_IXIndexer , self ).__init__ (name , obj )
13371333
13381334 def _has_valid_type (self , key , axis ):
13391335 if isinstance (key , slice ):
0 commit comments