Contact: aviboots(AT)netvision.net.il
39,880 questions
51,806 answers
573 users
import numpy as np arr1 = np.array([[2, 4, 9, 1], [8, 5, 0, 3]]) N = 4 result = np.power(arr1, N) print(result) ''' run: [[ 16 256 6561 1] [4096 625 0 81]] '''
import numpy as np arr1 = np.array([[2, 4, 9, 1], [8, 5, 0, 3]]) N = 4 result = np.float_power(arr1, N) print(result) ''' run: [[1.600e+01 2.560e+02 6.561e+03 1.000e+00] [4.096e+03 6.250e+02 0.000e+00 8.100e+01]] '''