2017-12-10 19:27:01
Broadcasting 广播机制广泛用于数据处理。
import numpy as np A = np.array([[56.0, 0.0, 4.4, 68.0], [1.2, 104.0, 52.0, 8.0], [1.8, 135.0, 99.0, 0.9]]) print(A) cal = A.sum(axis = 0) print(cal) percentage = 100 * A/cal.reshape(1,4) print(percentage)
时间: 2024-10-14 08:50:59