A RetroSearch Logo

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

Search Query:

Showing content from https://pandas.pydata.org/pandas-docs/stable/reference/api/../api/pandas.MultiIndex.truncate.html below:

pandas.MultiIndex.truncate — pandas 2.3.1 documentation

pandas.MultiIndex.truncate#
MultiIndex.truncate(before=None, after=None)[source]#

Slice index between two labels / tuples, return new MultiIndex.

Parameters:
beforelabel or tuple, can be partial. Default None

None defaults to start.

afterlabel or tuple, can be partial. Default None

None defaults to end.

Returns:
MultiIndex

The truncated MultiIndex.

Examples

>>> mi = pd.MultiIndex.from_arrays([['a', 'b', 'c'], ['x', 'y', 'z']])
>>> mi
MultiIndex([('a', 'x'), ('b', 'y'), ('c', 'z')],
           )
>>> mi.truncate(before='a', after='b')
MultiIndex([('a', 'x'), ('b', 'y')],
           )

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