A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pandas.pydata.org/docs/dev/user_guide/../reference/api/pandas.MultiIndex.from_tuples.html below:

pandas.MultiIndex.from_tuples — pandas 3.0.0.dev0+2231.g4f2aa4d2be documentation

pandas.MultiIndex.from_tuples#
classmethod MultiIndex.from_tuples(tuples, sortorder=None, names=None)[source]#

Convert list of tuples to MultiIndex.

Parameters:
tupleslist / sequence of tuple-likes

Each tuple is the index of one row/column.

sortorderint or None

Level of sortedness (must be lexicographically sorted by that level).

nameslist / sequence of str, optional

Names for the levels in the index.

Returns:
MultiIndex

Examples

>>> tuples = [(1, "red"), (1, "blue"), (2, "red"), (2, "blue")]
>>> pd.MultiIndex.from_tuples(tuples, names=("number", "color"))
MultiIndex([(1,  'red'),
            (1, 'blue'),
            (2,  'red'),
            (2, 'blue')],
           names=['number', 'color'])

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4