bool类型转int, 或者bool数组对象转int/float数组对象

bool value(one element) to int

int(True)


bool array to int array

(np.array([True])).astype(np.int32)

import numpy as np

(np.array([True])).astype(np.float32)

猜你喜欢

转载自blog.csdn.net/Linli522362242/article/details/106983216