import numpy as np
# creating 1D array
arr1=np.array([1,2,3,4,5])
print("1D array",arr1)
#addition :add 5 to each element
arr_add = arr1+5
print("after addition",arr_add)
#subtraction:subtract 2 from each element
arr_sub= arr1-2
print("after subtracting 2:",arr_sub)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: