It seems to be some kind of horizontal concatenation, but I could not find any documentation online. Here a minimal working example:
In [1]: from numpy impo
It took me a lot of time to understand but it seems I finally got it.
All you have to do is add along second axis.
let's take :
np.c_[np.array([1,2,3]), np.array([4,5,6])]
But there isn't second axis. So we mentally add one.
so shape of both array becomes (3,1)
.
So resultant shape would be (3,1+1) which is (3,2). which is the shape of result -
array([[1, 4],
[2, 5],
[3, 6]])
Another ex.:
np.c_[np.array([[1,2,3]]), 0, 0, np.array([[4,5,6]])]
shapes:
np.array([[1,2,3]])
= 1,3
np.array([[4,5,6]])
= 1,3
0
so we can think of it as [[0]]
= 1,1
So result 1,3+1+1+3
= 1,8
which is the shape of result : array([[1, 2, 3, 0, 0, 4, 5, 6]])