Answers for "python sum lists element wise"

0

python sum lists element wise

import numpy as np
vector1 = np.array([1, 2, 3])
vector2 = np.array([4, 5, 6])

#Doing the element-wise addition is now as trivial as:
sum_vector = vector1 + vector2
print(sum_vector)

# [5 7 9]
Posted by: Guest on July-26-2021

Code answers related to "python sum lists element wise"

Python Answers by Framework

Browse Popular Code Answers by Language