pandas.Index.insert
- Index.insert(loc, item)
Make new Index inserting new item at location.
Follows Python numpy.insert semantics for negative values.
- Parameters:
- loc : int
- item : object
- Returns:
Make new Index inserting new item at location.
Follows Python numpy.insert semantics for negative values.
>>> idx = pd.Index(['a', 'b', 'c'])
>>> idx.insert(1, 'x')
Index(['a', 'x', 'b', 'c'], dtype='object')