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.Index.putmask.html below:

pandas.Index.putmask — pandas 3.0.0.dev0+2232.ga2315af1df documentation

pandas.Index.putmask#
Index.putmask(mask, value)[source]#

Return a new Index of the values set with the mask.

Parameters:
masknp.ndarray[bool]

Array of booleans denoting where values in the original data are not NA.

valuescalar

Scalar value to use to fill holes (e.g. 0). This value cannot be a list-likes.

Returns:
Index

A new Index of the values set with the mask.

See also

numpy.putmask

Changes elements of an array based on conditional and input values.

Examples

>>> idx1 = pd.Index([1, 2, 3])
>>> idx2 = pd.Index([5, 6, 7])
>>> idx1.putmask([True, False, False], idx2)
Index([5, 2, 3], 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