So I have changed my previous code
if advice[i] == real_choice[i]:
correct[i] = "CORRECT"
else:
correct[i] = "INCORRECT"
to
correct = np.where( advice == real_choice, "CORRECT", "INCORRECT")
but now my code after this, that calculates the number of occurrences of the string "INCORRECT"
in correct
, no longer works:
num_incorrect = correct.str.count("INCORRECT").sum()
how can I do the above line in a way that is compatible with the new method?