numpy difference between two arrays

Solutions on MaxInterview for numpy difference between two arrays by the best coders in the world

showing results for - "numpy difference between two arrays"
Sara
15 Jan 2017
1import numpy as np
2
3a = np.array([[4, 3], [2, 1]])
4b = np.array([[1, 2], [3, 4]])
5print(a@b)
6# [[13 20]
7#  [ 5  8]]
8
Debora
06 Nov 2018
1import numpy as np
2
3a = np.mat('4 3; 2 1')
4b = np.mat('1 2; 3 4')
5print(a)
6# [[4 3]
7#  [2 1]]
8print(b)
9# [[1 2]
10#  [3 4]]
11print(a*b)
12# [[13 20]
13#  [ 5  8]]
14
Greta
29 Nov 2019
1import numpy as np
2result = np.subtract([1.1, 2.2, 3.3], [1, 2, 3])
similar questions
queries leading to this page
numpy difference between two arrays