numpy.c
is an indexing routine in NumPy that translates slice objects to concatenation along the second axis.
np.c_[arrays]
numpy.c_
is not a function. Hence, it doesn’t take any parameter value.
numpy.c_
returns a concatenated array.
import numpy as np# creating arraysmyarray1 = np.array([1, 2, 3])myarray2 = np.array([4, 5, 6])# using the numpy.c_myarray = np.c_[myarray1, myarray2]print(myarray)
numpy
module.myarray1
and myarray2
using the array()
function.numpy.c_
indexing routine to concatenate the two arrays. The result is assigned to a variable myarray
.myarray
.