Questions tagged «scilab»

6
如何将布尔数组转换为int数组
我使用Scilab,并希望将布尔数组转换为整数数组: >>> x = np.array([4, 3, 2, 1]) >>> y = 2 >= x >>> y array([False, False, True, True], dtype=bool) 在Scilab中,我可以使用: >>> bool2s(y) 0. 0. 1. 1. 甚至只是将其乘以1: >>> 1*y 0. 0. 1. 1. 在Python中是否有一个简单的命令,还是我必须使用循环?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.