I have a dataframe. I want to set all values that are less than x, in rows that have a certain parameter value, to a new value.
I try this, but nothing happens to my dataframe.
df_data = {'A': [4, 4, 5, 5],
'B': [4, 4, 4, 5],
'C': [4, 5, 5, 5],
'Bool': [True, True, False, False]}
test_df = pd.DataFrame(df_data, columns=['A', 'B', 'C', 'Bool'])
test_df[test_df.iloc[:, :-1] < 5][test_df['Bool'] == True] = 99
print(test_df)
I expect some elements in the test_df to have value 99.