How to Compute Addition of Two Array in NumPy


In this example, we will learn how to compute the addition of two arrays using the add() function in Python NumPy.

Source Code

import numpy as np

a = [1, 2, 3, 4]
b = [5, 6, 7, 8]

c = np.add(a, b)
print(c)

Output:

[ 6  8 10 12]
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Advertisement