Iterating over a numpy array and operating on each element
问题 I have a numpy array of size 8x8. Here is the numpy array: QuantTable = np.array([[16, 11 ,10, 16, 24, 40, 51, 61], [12, 12, 14, 19, 26, 58, 60, 55], [14, 13, 16, 24, 40, 57, 69, 56], [14, 17, 22, 29, 51, 87, 80, 62], [18, 22, 37, 29, 51, 87, 80, 62], [24, 35, 55, 64, 81, 109, 103, 77], [49, 64, 78, 87, 103, 121, 120, 101], [72, 92, 95, 98, 112, 100, 103, 99]]) I would like to perform the operations on the elements in the array. I have created a function that accepts a scaling factor value