MultiIndex.
from_tuples
Convert list of tuples to MultiIndex.
Each tuple is the index of one row/column.
Level of sortedness (must be lexicographically sorted by that level).
Names for the levels in the index.
Examples
>>> tuples = [(1, 'red'), (1, 'blue'), ... (2, 'red'), (2, 'blue')] >>> ps.MultiIndex.from_tuples(tuples, names=('number', 'color')) MultiIndex([(1, 'red'), (1, 'blue'), (2, 'red'), (2, 'blue')], names=['number', 'color'])