I have an input array that looks like this:
[[ 0. 1. ]
[ 10. 0.4]
[ 20. 1.4]
[ 30. 3. ]
[ 40. 1.1]
[ 50. 0.7]]
Now I'd like to convert the float values from the second column (the ones in array[:, 1]) to single bit binary values represented as 1 or 0 integers. I have threshold value that I'd like to use as a limit between logical 0 and logical 1. Let's say it is 1.5. After the conversion the array should look like this:
[[ 0. 0 ]
[ 10. 0]
[ 20. 0]
[ 30. 1]
[ 40. 0]
[ 50. 0]]
How do I do that with the least effort?
1.0) you have switch to a structured array, or just put the binary values in a separate array.