diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 4d8b831b7d63f..b5462bbe67647 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -3359,8 +3359,9 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False, inplace = validate_bool_kwarg(inplace, 'inplace') # 10726 if by is not None: - warnings.warn("by argument to sort_index is deprecated, please use " - ".sort_values(by=...)", FutureWarning, stacklevel=2) + warnings.warn("by argument to sort_index is deprecated, " + "please use .sort_values(by=...)", + FutureWarning, stacklevel=2) if level is not None: raise ValueError("unable to simultaneously sort by and level") return self.sort_values(by, axis=axis, ascending=ascending,