pyspark.pandas.MultiIndex.equal_levels

MultiIndex.equal_levels(other: pyspark.pandas.indexes.multi.MultiIndex) → bool

Return True if the levels of both MultiIndex objects are the same

Examples

>>> psmidx1 = ps.MultiIndex.from_tuples([("a", "x"), ("b", "y"), ("c", "z")])
>>> psmidx2 = ps.MultiIndex.from_tuples([("b", "y"), ("a", "x"), ("c", "z")])
>>> psmidx1.equal_levels(psmidx2)
True
>>> psmidx2 = ps.MultiIndex.from_tuples([("a", "x"), ("b", "y"), ("c", "j")])
>>> psmidx1.equal_levels(psmidx2)
False