Skip to content
murmot

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

  • numpy.org

    Interoperability with NumPy — NumPy v2.6.dev0 Manual

    1. Using arbitrary objects in NumPy#. The first set of interoperability features from the NumPy API allows foreign objects to be treated as NumPy arrays whenever possible. When NumPy functions encounter a foreign object, they will try (in order)

  • numpy.org

    numpy.arange — NumPy v2.7.dev0 Manual

    For integer arguments the function is roughly equivalent to the Python ... In this case, it ensures the creation of an array object compatible with that passed in ...

  • numpy.org

    Interoperability with NumPy — NumPy v2.1 Manual

    When NumPy functions encounter a foreign object, they will try (in order): The buffer protocol, described in the Python C-API documentation.Example: CuPy arrays#. CuPy is a NumPy/SciPy-compatible array library for GPU-accelerated computing with Python.

  • 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

    Interoperability with NumPy — NumPy v2.0 Manual

    __array__(): a method returning the NumPy ndarray copy or a view of an array-like object; The __array_interface__ attribute can be inspected directlyExample: CuPy arrays#. CuPy is a NumPy/SciPy-compatible array library for GPU-accelerated computing with Python.

  • numpy.org

    Data types — NumPy v2.5 Manual

    astype() method. For example: >>> z.astype(np.float64) array([0., 1., 2.]) Note that, above, we could have used the Python float object as a dtype instead of ...

  • numpy.org

    Array API — NumPy v2.6.dev0 Manual

    This is the main array creation function. Most new arrays are created with this flexible function. The returned object is an object of Python-type subtype, which must be a subtype of PyArray_Type. The array has nd dimensions, described by dims.

  • numpy.org

    numpy.vectorize — NumPy v2.6.dev0 Manual

    Returns an object that acts like pyfunc, but takes arrays as input. Define a vectorized function which takes a nested sequence of objects or numpy arrays as inputs and returns a single numpy array or a tuple of numpy arrays.Takes an arbitrary Python function and returns a ufunc.