How to convert a boolean array to an int array

前端 未结 0 1493
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-23 06:26

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
>>         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题