Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import numpy as np
# 2 dimensional arrays
a1=np.ones([2,1])
print (a1)
#Output:
[[1.]
[1.]]
a2=np.arange(1,5).reshape(2,2)
print (a2)
#Output
[[1 2]
[3 4]]
print (a1+a2)
#Output:
[[2. 3.]
[4. 5.]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment