Categories
pandas python

TypeError: Cannot do inplace boolean setting on mixed-types with a non np.nan value

I am getting the error TypeError: Cannot do inplace boolean setting on mixed-types with a non np.nan value when I try to replace numeric values in multiple columns by a specific string value.

df =
TYPE VD_1 VD_2 VD_3
AAA 1234 22122 2345
AAA 1234 2345 22122

This is how I do it:

df[df.isin([22122])] = "English"

or

df[df==22122] = "English"