When using pylint to check my code, it reported an error:
E1137: 'df' does not support item assignment (unsupported-assignment-operation)
for the origin code:
df["column1"] = "hello"
It looks like we have no choice but to use operation .loc
in pandas to avoid this error.
# Set all rows in "column1" to "hello" df.loc[:, "column1"] = "hello"