It's generally a bad idea to from package import * as you can override other packages in your namespace. Numpy has a built in solution to add two arrays together:
import numpy as np
arr1 = np.array([5,10,15,20,30])
arr2 = np.array([55,16,1,280,60])
arr1+arr2
array([ 60, 26, 16, 300, 90]) # 435 ns ± 5.89 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
Though, you need the two arrays to have the same length.
If you want to use some standard python functions (and not a for loop) you can use map and zip to handle to arrays that aren't the same length:
list(map(sum, zip(arr1,arr2)))
[60, 26, 16, 300, 90] # 4.45 µs ± 60.2 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
If you want to use a for loop you can do this:
new_list = []
for i in range(min(len(arr1), len(arr2))):
new_list.append(arr1[i]+arr2[i])
new_list
[60, 26, 16, 300, 90] # 2.71 µs ± 307 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
All of these assume you want to stop when you reach the end of the shortest list.
arr3 = arr1 + arr2for equal shape numpy arrays. If shapes differ the problem is ill defined.