Skip to content
murmot

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

  • 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.

  • numpy.org

    Array API — NumPy v2.5 Manual

    Return -1 if an error occurs or 0 on success. Note. In general, prefer the use of PyArray_Pack when handling arbitrary Python objects. Setitem is for example ...

  • numpy.org

    Python types and C-structures — NumPy v2.3 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

    Array API — NumPy v2.6.dev0 Manual

    The memory for the array can be set to zero if desired using PyArray_FILLWBYTE (return_object, 0).This function cannot be used to create a flexible-type array (no itemsize given).

  • numpy.org

    NumPy C code explanations

    A very common operation in much of NumPy code is the need to iterate over all the elements of a general, strided, N-dimensional array. This operation of a ...

  • numpy.org

    Python types and C-structures — NumPy v2.0 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

    numpy.fromfunction — NumPy v2.5 Manual

    Reference object to allow the creation of arrays which are not NumPy arrays. If an array-like passed in as like supports the __array_function__ protocol, the result will be defined by it.

  • numpy.org

    numpy.array — NumPy v2.7.dev0 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.

  • numpy.org

    Beyond the Basics — NumPy v1.15 Manual

    The returned object is an array-iterator object (the same object returned by the .flat attribute of the ndarray).Very often, it is desirable to iterate over several arrays at the same time. The universal functions are an example of this kind of behavior.

  • numpy.org

    Array creation — NumPy v2.5 Manual

    There are 6 general mechanisms for creating arrays: Conversion from other Python structures (i.e. lists and tuples). Intrinsic NumPy array creation functions ( ...

  • numpy.org

    NEP 35 — Array creation dispatching with __array_function__

    Oct 15, 2019 · To permit __array_function__ dispatching, one possible implementation is to decorate Python functions with overrides.array_function_dispatch, but C functions have a different requirement, which we shall describe shortly.