Q:

numpy subtract matrix from matrix

import numpy as np
np.subtract(1.0, 4.0)
0
# Python program explaining 
# numpy.subtract() function 
  
import numpy as geek 
  
in_arr1 = geek.array([[2, -4, 5], [-6, 2, 0]]) 
in_arr2 = geek.array([[0, -7, 5], [5, -2, 9]]) 
   
print ("1st Input array : ", in_arr1) 
print ("2nd Input array : ", in_arr2) 
   
    
out_arr = geek.subtract(in_arr1, in_arr2)  
print ("Output array: ", out_arr)  
0

New to Communities?

Join the community