Skip to content

Commit e36d3a7

Browse files
qwhelanPingviinituutti
authored andcommitted
PERF: speed up .ix by moving deprecation string out of __init__ (pandas-dev#24747)
1 parent e349750 commit e36d3a7

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

pandas/core/indexing.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -1405,17 +1405,16 @@ class _IXIndexer(_NDFrameIndexer):
14051405
See more at :ref:`Advanced Indexing <advanced>`.
14061406
"""
14071407

1408-
def __init__(self, name, obj):
1409-
1410-
_ix_deprecation_warning = textwrap.dedent("""
1411-
.ix is deprecated. Please use
1412-
.loc for label based indexing or
1413-
.iloc for positional indexing
1408+
_ix_deprecation_warning = textwrap.dedent("""
1409+
.ix is deprecated. Please use
1410+
.loc for label based indexing or
1411+
.iloc for positional indexing
14141412
1415-
See the documentation here:
1416-
http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated""") # noqa
1413+
See the documentation here:
1414+
http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated""") # noqa
14171415

1418-
warnings.warn(_ix_deprecation_warning,
1416+
def __init__(self, name, obj):
1417+
warnings.warn(self._ix_deprecation_warning,
14191418
DeprecationWarning, stacklevel=2)
14201419
super(_IXIndexer, self).__init__(name, obj)
14211420

0 commit comments

Comments
 (0)