modin.pandas.DataFrame.insert¶
- DataFrame.insert(loc: int, column: Hashable, value: Scalar | AnyArrayLike, allow_duplicates: bool | NoDefault = _NoDefault.no_default) None[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.26.0/snowpark-python/src/snowflake/snowpark/modin/plugin/extensions/dataframe_overrides.py#L1170-L1262)¶
Insert column into DataFrame at specified location.
Raises a ValueError if column is already contained in the DataFrame, unless allow_duplicates is set to True.
- Parameters:
loc (int) – Insertion index. Must verify 0 <= loc <= len(columns).
column (str, number, or hashable object) – Label of the inserted column.
value (Scalar, Series, or array-like) –
allow_duplicates (bool, optional, default lib.no_default) –
See also
Index.insertInsert new item by index.
Examples
Notice that pandas uses index alignment in case of value from type Series: