What will the following code result in? A = np.array ([12, 23])
What will the following code result in?
import numpy as np
A = np.array ([12, 23])
B = np.array ([10, 20])
print (A-B)
Show answerHide answer
Correct answer: (D) [2 3]
Explanation
NumPy subtracts arrays element by element: [12−10, 23−20] = [2 3]. It does not stack or combine the arrays.