d = {'col1': [1.1, 2.1, "ERR", 0.1], 'col2': [3, 4, 5, 6]}
df = pd.DataFrame(data=d)
print(df)
df["t"] = np.where(df["col1"] == "ERR", "T", "F")
df["test"] = np.where(df["col1"] == "ERR", df["col1"], df["col1"]*1)
df["test"] = np.where(df["col1"] == "ERR", df["col1"], df["col1"]*1.1)
print(df)
# works fine
df["test"] = np.where(df["col1"] == "ERR", df["col1"], df["col1"]*1)
# TypeError: can't multiply sequence by non-int of type 'float'
df["test"] = np.where(df["col1"] == "ERR", df["col1"], df["col1"]*1.1)
Not able to understand why this is happening