MCPcopy
hub / github.com/numpy/numpy / concatenate

Function concatenate

numpy/_core/multiarray.py:198–309  ·  view source on GitHub ↗

concatenate( arrays, /, axis=0, out=None, *, dtype=None, casting="same_kind", ) -- Join a sequence of arrays along an existing axis. .. versionadded:: 2.0 ``numpy.concat`` added as a shorthand for ``numpy.concaten

(arrays, axis=0, out=None, *, dtype=None, casting="same_kind")

Source from the content-addressed store, hash-verified

196
197@array_function_from_c_func_and_dispatcher(_multiarray_umath.concatenate)
198def concatenate(arrays, axis=0, out=None, *, dtype=None, casting="same_kind"):
199 """
200 concatenate(
201 arrays,
202 /,
203 axis=0,
204 out=None,
205 *,
206 dtype=None,
207 casting="same_kind",
208 )
209 --
210
211 Join a sequence of arrays along an existing axis.
212
213 .. versionadded:: 2.0
214 ``numpy.concat`` added as a shorthand for ``numpy.concatenate``.
215
216 Parameters
217 ----------
218 a1, a2, ... : sequence of array_like
219 The arrays must have the same shape, except in the dimension
220 corresponding to `axis` (the first, by default).
221 axis : int, optional
222 The axis along which the arrays will be joined. If axis is None,
223 arrays are flattened before use. Default is 0.
224 out : ndarray, optional
225 If provided, the destination to place the result. The shape must be
226 correct, matching that of what concatenate would have returned if no
227 out argument were specified.
228 dtype : str or dtype
229 If provided, the destination array will have this dtype. Cannot be
230 provided together with `out`.
231
232 .. versionadded:: 1.20.0
233
234 casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
235 Controls what kind of data casting may occur. Defaults to 'same_kind'.
236 For a description of the options, please see :term:`casting`.
237
238 .. versionadded:: 1.20.0
239
240 Returns
241 -------
242 res : ndarray
243 The concatenated array.
244
245 See Also
246 --------
247 ma.concatenate : Concatenate function that preserves input masks.
248 array_split : Split an array into multiple sub-arrays of equal or
249 near-equal size.
250 split : Split array into a list of multiple sub-arrays of equal size.
251 hsplit : Split array into multiple sub-arrays horizontally (column wise).
252 vsplit : Split array into multiple sub-arrays vertically (row wise).
253 dsplit : Split array into multiple sub-arrays along the 3rd axis (depth).
254 stack : Stack a sequence of arrays along a new axis.
255 block : Assemble arrays from blocks.

Callers 8

test_concatenateMethod · 0.90
test_bad_out_shapeMethod · 0.90
test_out_and_dtypeMethod · 0.90
original_fftshiftMethod · 0.90
original_ifftshiftMethod · 0.90
_leading_trailingFunction · 0.70
resizeFunction · 0.70

Calls

no outgoing calls

Tested by 6

test_concatenateMethod · 0.72
test_bad_out_shapeMethod · 0.72
test_out_and_dtypeMethod · 0.72
original_fftshiftMethod · 0.72
original_ifftshiftMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…