A RetroSearch Logo

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

Search Query:

Showing content from https://pandas.pydata.org/docs/reference/api/pandas.api.extensions.ExtensionArray.insert.html below:

pandas.api.extensions.ExtensionArray.insert — pandas 2.3.1 documentation

pandas.api.extensions.ExtensionArray.insert#
ExtensionArray.insert(loc, item)[source]#

Insert an item at the given position.

Parameters:
locint
itemscalar-like
Returns:
same type as self

Notes

This method should be both type and dtype-preserving. If the item cannot be held in an array of this type/dtype, either ValueError or TypeError should be raised.

The default implementation relies on _from_sequence to raise on invalid items.

Examples

>>> arr = pd.array([1, 2, 3])
>>> arr.insert(2, -1)
<IntegerArray>
[1, 2, -1, 3]
Length: 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