nlcpy.concatenate

nlcpy.concatenate(arrays, axis=0, out=None)[ソース]

Joins a sequence of arrays along an existing axis.

Parameters
arrayssequence of array_like

The arrays must have the same shape, except in the dimension corresponding to axis (the first, by default).

axisint, optional

The axis along which the arrays will be joined. If axis is None, arrays are flattened before use. Default is 0.

outndarray, optional

If provided, the destination to place the result. The shape must be correct, matching that of what concatenate would have returned if no out argument were specified.

Returns
resndarray

The concatenated array.

Examples

>>> import nlcpy as vp
>>> a = vp.array([[1, 2], [3, 4]])
>>> b = vp.array([[5, 6]])
>>> vp.concatenate((a, b), axis=0)
array([[1, 2],
       [3, 4],
       [5, 6]])
>>> vp.concatenate((a, b.T), axis=1)
array([[1, 2, 5],
       [3, 4, 6]])
>>> vp.concatenate((a, b), axis=None)
array([1, 2, 3, 4, 5, 6])