Converting numpy boolean array to binary array
Let x be your data in numpy array Boolean format.
Try
np.where(x,255,0)
I have a boolean numpy array which I need to convert it to binary, therefore where there is true it should be 255 and where it is false it should be 0.
Can someone point me out how to write the code?