MCPcopy Create free account
hub / github.com/numpy/numpy / concat

Function concat

numpy/array_api/_manipulation_functions.py:11–23  ·  view source on GitHub ↗

Array API compatible wrapper for :py:func:`np.concatenate `. See its docstring for more information.

(
    arrays: Union[Tuple[Array, ...], List[Array]], /, *, axis: Optional[int] = 0
)

Source from the content-addressed store, hash-verified

9
10# Note: the function name is different here
11def concat(
12 arrays: Union[Tuple[Array, ...], List[Array]], /, *, axis: Optional[int] = 0
13) -> Array:
14 """
15 Array API compatible wrapper for :py:func:`np.concatenate <numpy.concatenate>`.
16
17 See its docstring for more information.
18 """
19 # Note: Casting rules here are different from the np.concatenate default
20 # (no for scalars with axis=None, no cross-kind casting)
21 dtype = result_type(*arrays)
22 arrays = tuple(a._array for a in arrays)
23 return Array._new(np.concatenate(arrays, axis=axis, dtype=dtype))
24
25
26def expand_dims(x: Array, /, *, axis: int) -> Array:

Callers 1

test_concat_errorsFunction · 0.85

Calls 2

_newMethod · 0.80
result_typeFunction · 0.70

Tested by 1

test_concat_errorsFunction · 0.68