scilab

How to convert a boolean array to an int array

How to convert a boolean array to an int array Question: I use Scilab, and want to convert an array of booleans into an array of integers: >>> x = np.array([4, 3, 2, 1]) >>> y = 2 >= x >>> y array([False, False, True, True], dtype=bool) In Scilab I can use: >>> bool2s(y) 0. …

Total answers: 6