BUG/DEPR: loc.setitem incorrectly accepting positional slices by jbrockmendel · Pull Request #31840 · pandas-dev/pandas (original) (raw)
The 2D case is something like this?
df.iloc[:4, ['A', 'B'] = 1
I'd say something like "use .loc with labels, or .iloc with positions instead." I don't think we can really say which will be easier for the user in the error message, so just don't take a position.