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 converts several 1D arrays into a 2D array, with the single dimension of the original arrays preserved as the 1st dimension of the 2D array. The multiple input arrays are used as the 2nd dimension.
Think of it this way: If you have data series of 30 records apiece collected into separate 1D arrays, np.c_ combines these series as you would in an excel table: side-by-side in separate columns of 30, rather than extending the first series.
For example, 2 starting arrays:
>>> arrayX = np.array([X1,X2...,X30])
array([X1, X2..., X30])
>>> arrayY = np.array([Y1,Y2...,Y30])
array([Y1, Y2..., Y30])
Let's see how np.c_ combines them:
>>>arrayC = np.c_(arrayX, arrayY)
array([[X1, Y1],
[X2, Y2],
...
[X30, Y30]])
See how it's still 30 records long? You can now use the 2nd dimension to navigate between data series.
The documentation somewhat cryptically states: "Translates slice objects to concatenation along the second axis." Second axis of what? The resulting 2D array, they mean. It's unclear if you don't know that this a variation of np.r_, which concatenates along the first axis; and also if you don't think of a 1D array as having another dimension. But syntactically, it kinda does.
Query the shape of the arrays to illustrate this:
>>> np.shape(arrayX)
(30,)
>>> np.shape(arrayY)
(30,)
>>> np.shape(arrayC)
(30,2)
You can see a 2nd dimension, or axis, is created by the np.c_ method, and the concatenation takes place there. By contrast:
>>> arrayR = np.r_[array1,array2]
array([X1, X2..., X30, Y1, Y2..., Y30])
>>> np.shape(arrayR)
(60,)
The np.r_ method concatenates within the first dimension, or along the first axis.