Skip to content
murmot

Results for “function return python array java example site:numpy.org code”

  • numpy.org

    F2PY examples — NumPy v2.6.dev0 Manual

    This example shows a function that filters a two-dimensional array of double precision floating-point numbers using a fixed averaging filter. The advantage of using Fortran to index into multi-dimensional arrays should be clear from this example.

  • numpy.org

    numpy.ravel — NumPy v2.5 Manual

    Return a contiguous flattened array. A 1-D array, containing the elements of ... (for example, a masked array will be returned for a masked array input).

  • numpy.org

    numpy.argsort — NumPy v2.5 Manual

    If True, the returned array will maintain the relative order of a values which compare as equal. If False or None, this is not guaranteed.As of NumPy 1.4.0 argsort works with real/complex arrays containing nan values. The enhanced sort order is documented in sort. Examples.

  • numpy.org

    Array API — NumPy v2.6.dev0 Manual

    This function returns a (C-style) contiguous and behaved function array from ... The example template-code below shows a typical usage: mps ...

  • numpy.org

    Indexing on ndarrays — NumPy v2.5 Manual

    See Assigning values to indexed arrays for specific examples and explanations on how assignments work. Note that in Python, x[(exp1, exp2, ..., expN)] is equivalent to x[exp1, exp2, ..., expN]; the latter is just syntactic sugar for the former.

  • numpy.org

    numpy.arange — NumPy v2.7.dev0 Manual

    For integer arguments the function is roughly equivalent to the Python built-in range , but returns an ndarray rather than a range instance. When using a ...

  • numpy.org

    Writing your own ufunc — NumPy v1.18 Manual

    Example NumPy ufunc with multiple arguments/return values.Once the spam module is imported into python, you can call logit via spam.logit. Note that the function used above cannot be applied as-is to numpy arrays. To do so we must call numpy.vectorize on it.

  • numpy.org

    Data types — NumPy v2.5 Manual

    Array types can also be referred to by character codes, for example: >>> np.array([1, 2, 3], dtype='f') array([1., 2., 3.], dtype=float32) >>> np.array ...