Answers for "sum arrays element wise python"

8

find sum of 2 numbers in array using python

a = int(input("Enter first number:"))
b = int(input("Enter second number:"))
sum = a+b
print(sum)
Posted by: Guest on March-06-2020
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 "sum arrays element wise python"

Python Answers by Framework

Browse Popular Code Answers by Language