TYP: DataFrame.(index|columns) and Series.index by topper-123 · Pull Request #31126 · pandas-dev/pandas (original) (raw)

isn't this is a breaking change?

this PR

pd.DataFrame().swaplevel() Traceback (most recent call last): File "", line 1, in File "C:\Users\simon\pandas\pandas\core\frame.py", line 5270, in swaplevel assert isinstance(result.index, ABCMultiIndex) AssertionError

on master

pd.DataFrame().swaplevel() Traceback (most recent call last): File "", line 1, in File "C:\Users\simon\pandas\pandas\core\frame.py", line 5268, in swaplevel result.index = result.index.swaplevel(i, j) AttributeError: 'Index' object has no attribute 'swaplevel'