0

I need to apply the if condition and I have previously defined the random forest regression input data frame using pandas as follows:

rf_datas = rf_datas.sample(frac=1, replace = False).reset_index(drop=True)

if rf_datas.sample.(replace == True):
        acc_600_repl.append(accuracy)
else:
        acc_600.append(accuracy)

The problem is python doesn't accept the if condition as it is shown above. I need to know how to refer to a parameter (replace) value (False) in that if condition?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Abboud
  • 9
  • 4
  • You have to ensure that the condition after `if` returns a single boolean, so aggregate with `all`/`any` if needed or slice. – mozway May 26 '23 at 08:46

0 Answers0