MultiIndex.
insert
Make new MultiIndex inserting new item at location.
Follows Python list.append semantics for negative values.
Examples
>>> psmidx = ps.MultiIndex.from_tuples([("a", "x"), ("b", "y"), ("c", "z")]) >>> psmidx.insert(3, ("h", "j")) MultiIndex([('a', 'x'), ('b', 'y'), ('c', 'z'), ('h', 'j')], )
For negative values
>>> psmidx.insert(-2, ("h", "j")) MultiIndex([('a', 'x'), ('h', 'j'), ('b', 'y'), ('c', 'z')], )