Skip to content
murmot

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

  • numpy.org

    How to extend NumPy — NumPy v1.15 Manual

    The following example shows how you might write a wrapper that accepts two input arguments (that will be converted to an array) and an output argument (that must be an array). The function returns None and updates the output array.

  • numpy.org

    The array interface protocol — NumPy v2.5 Manual

    version: 3 The array interface (sometimes called array protocol) was created in 2005 as a means for array-like Python objects to reuse each other’s data buffers intelligently whenever possible. The homogeneous N-dimensional array interface is a default mechanism for objects to share N-dimensional array memory and information. The interface consists of a Python-side and a C-side using two ...

  • numpy.org

    numpy.ravel — NumPy v2.5 Manual

    ... returned array will have the same type as the input array. (for example, a masked array will be returned for a masked array input). Parameters: aarray_like.

  • numpy.org

    Python types and C-structures — NumPy v2.1 Manual

    A pointer to a function that sets the Python object item into the array, arr, at the position pointed to by data . This function deals with “misbehaved” arrays. If successful, a zero is returned, otherwise, a negative one is returned (and a Python error set).

  • numpy.org

    Python types and C-structures — NumPy v2.5 Manual

    The __array_struct__ method of an object that supports the rapid array interface protocol should return a PyCapsule that contains a pointer to a PyArrayInterface structure with the relevant details of the array.

  • 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

    Array API — NumPy v2.0 Manual

    Return the bytes of this array in a Python string.For example, suppose the GIL has been released (using the previous calls), and then some path in the code (perhaps in a different subroutine) requires use of the Python C-API, then these macros are useful to acquire the GIL.

  • numpy.org

    Using NumPy C-API — NumPy v2.5 Manual

    Using NumPy C-API # How to extend NumPy Writing an extension module Required subroutine Defining functions Functions without keyword arguments Functions with keyword arguments Reference counting Dealing with array objects Converting an arbitrary sequence object Creating a brand-new ndarray Getting at ndarray memory and accessing elements of the ...

  • numpy.org

    numpy.meshgrid — NumPy v2.5 Manual

    If True the shape of the returned coordinate array for dimension i is ... Giving the string 'ij' returns a meshgrid with matrix indexing, while 'xy ...

  • numpy.org

    Array API — NumPy v1.24 Manual

    Return the bytes of this array in a Python string.For example, suppose the GIL has been released (using the previous calls), and then some path in the code (perhaps in a different subroutine) requires use of the Python C-API, then these macros are useful to acquire the GIL.

  • numpy.org

    Standard array subclasses — NumPy v2.5 Manual

    Starting from numpy 1.4, if one needs arrays of strings, it is recommended to use arrays of dtype object_, bytes_ or str_, and use the free functions in the numpy.char module for fast vectorized string operations.

  • numpy.org

    numpy.mean — NumPy v2.2 Manual

    Compute the arithmetic mean along the specified axis. Returns the average of the array elements. The average is taken over the flattened array by default, ...

  • numpy.org

    Array API — NumPy v1.20 Manual

    Return the bytes of this array in a Python string.For example, suppose the GIL has been released (using the previous calls), and then some path in the code (perhaps in a different subroutine) requires use of the Python C-API, then these macros are useful to acquire the GIL.

  • numpy.org

    Using NumPy C-API

    Writing Performant NumPy Code with ... Example NumPy ufunc with multiple arguments/return values · Example NumPy ufunc with structured array dtype arguments.

  • numpy.org

    numpy.array — NumPy v2.5 Manual

    An array, any object exposing the array interface, an object whose __array__ method returns an array, or any (nested) sequence. If object is a scalar, a 0-dimensional array containing object is returned.