I'm trying to run the following piece of code:
TN = np.sum((1 - predict) * (1 - actual))
where I have predicted, the variable that I cannot modify, which gets printed as follow:
[False False False False False False]
without any comma, so I guess it is not a list. Then, I have actual which is formatted as:
[False, False, False, False, False, False]
They have the same length, but when I run the command above I get the error:
TypeError: unsupported operand type(s) for -: 'int' and 'list'
How can I convert the variable actual so it can be compared to predicted?
predictedis generated? can you know its type usingtype()?predictedseems to be a numpy array so if you convertactualto a numpy array you can do the operation:TN = np.sum((1 - predict) * (1 - np.array(actual)))