A RetroSearch Logo

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

Search Query:

Showing content from https://pandas.pydata.org/docs/dev/development/../reference/api/pandas.Index.intersection.html below:

pandas.Index.intersection — pandas 3.0.0.dev0+2231.g4f2aa4d2be documentation

pandas.Index.intersection#
final Index.intersection(other, sort=False)[source]#

Form the intersection of two Index objects.

This returns a new Index with elements common to the index and other.

Parameters:
otherIndex or array-like

An Index or an array-like object containing elements to form the intersection with the original Index.

sortTrue, False or None, default False

Whether to sort the resulting index.

  • None : sort the result, except when self and other are equal or when the values cannot be compared.

  • False : do not sort the result.

  • True : Sort the result (which may raise TypeError).

Returns:
Index

Returns a new Index object with elements common to both the original Index and the other Index.

See also

Index.union

Form the union of two Index objects.

Index.difference

Return a new Index with elements of index not in other.

Index.isin

Return a boolean array where the index values are in values.

Examples

>>> idx1 = pd.Index([1, 2, 3, 4])
>>> idx2 = pd.Index([3, 4, 5, 6])
>>> idx1.intersection(idx2)
Index([3, 4], dtype='int64')

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