numpy中True/False映射为0/1

array = np.array([True, False])

array.astype(int)