日期:2022-03-07 17:36:22
点击:59
内容简介:如下所示: import numpy as np a = np.random.randint(-5, 5, (5, 5)) aarray([[-4, -4, -5, 2, 1], [-1, -2, -1, 3, 3], [-1, -2, 3, -5, 3], [ 0, -3, -5, 1, -4], [ 0, 3, 1, 3, -4]])# 方式一 np.maximum(a, 0)array([[0, 0, 0, 2, 1], [0, 0, 0, 3, 3]...