pandas.DataFrame.isetitem

DataFrame.isetitem(loc, value)[source]

Set the given value in the column with position ‘loc’.

This is a positional analogue to __setitem__.

Parameters:
locint or sequence of ints
valuescalar or arraylike

Notes

Unlike frame.iloc[:, i] = value, frame.isetitem(loc, value) will _never_ try to set the values in place, but will always insert a new array.

In cases where frame.columns is unique, this is equivalent to frame[frame.columns[i]] = value.