I have a dataframe and I want to input to a slice of rows in a specific columns, where the input is a list of strings - so in each of the selected rows, I want the same list of strings.
But when I try this, I get an error:
df['col'].iloc[0:460] = ['x', 'y', 'z', 'q']
ValueError: cannot set using a slice indexer with a different length than the value
It works fine when I do the same but instead of a list of strings I just have a single string. Why won't it accept a list as input?