![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
numpy
weixin_41950276
这个作者很懒,什么都没留下…
展开
-
numpy将bool值转变为数值
label = np.array([0, 1, 0])predict_label = np.array([1, 0, 0])false_num = np.array(label != predict_label).astype(int)print(false_num) # [1 1 0]原创 2019-03-07 21:58:22 · 2044 阅读 · 1 评论 -
numpy中True/False映射为0/1
array = np.array([True, False])array.astype(int)原创 2019-04-20 20:42:28 · 1157 阅读 · 0 评论