MCPcopy
hub / github.com/numpy/numpy / append

Function append

numpy/ma/core.py:8961–9000  ·  view source on GitHub ↗

Append values to the end of an array. Parameters ---------- a : array_like Values are appended to a copy of this array. b : array_like These values are appended to a copy of `a`. It must be of the correct shape (the same shape as `a`, excluding `axis`). If

(a, b, axis=None)

Source from the content-addressed store, hash-verified

8959
8960
8961def append(a, b, axis=None):
8962 """Append values to the end of an array.
8963
8964 Parameters
8965 ----------
8966 a : array_like
8967 Values are appended to a copy of this array.
8968 b : array_like
8969 These values are appended to a copy of `a`. It must be of the
8970 correct shape (the same shape as `a`, excluding `axis`). If `axis`
8971 is not specified, `b` can be any shape and will be flattened
8972 before use.
8973 axis : int, optional
8974 The axis along which `v` are appended. If `axis` is not given,
8975 both `a` and `b` are flattened before use.
8976
8977 Returns
8978 -------
8979 append : MaskedArray
8980 A copy of `a` with `b` appended to `axis`. Note that `append`
8981 does not occur in-place: a new array is allocated and filled. If
8982 `axis` is None, the result is a flattened array.
8983
8984 See Also
8985 --------
8986 numpy.append : Equivalent function in the top-level NumPy module.
8987
8988 Examples
8989 --------
8990 >>> import numpy as np
8991 >>> import numpy.ma as ma
8992 >>> a = ma.masked_values([1, 2, 3], 2)
8993 >>> b = ma.masked_values([[4, 5, 6], [7, 8, 9]], 7)
8994 >>> ma.append(a, b)
8995 masked_array(data=[1, --, 3, 4, 5, 6, --, 8, 9],
8996 mask=[False, True, False, False, False, False, True, False,
8997 False],
8998 fill_value=999999)
8999 """
9000 return concatenate([a, b], axis)

Callers

nothing calls this directly

Calls 1

concatenateFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…