Skip to content
murmot

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

  • numpy.org

    Array API — NumPy v2.1 Manual

    It should return a -1 on error and 0 otherwise. Data access#. These functions and macros provide easy access to elements of the ndarray from C. These work for ...

  • numpy.org

    Writing custom array containers — NumPy v2.5 Manual

    Both functions return sets of functions that are present in the Numpy public API. User-defined ufuncs or ufuncs defined in other libraries that depend on Numpy are not present in these sets. Refer to the dask source code and cupy source code for more fully-worked examples of custom array containers. See also NEP 18.

  • numpy.org

    numpy.array — NumPy v2.7.dev0 Manual

    numpy.array# · An array, any object exposing the array interface, an object whose __array__ method returns an array, or any (nested) sequence. · The desired data- ...

  • 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: the absolute basics for beginners — NumPy v2.5 Manual

    NumPy (Num erical Py thon) is an open source Python library that’s widely used in science and engineering. The NumPy library contains multidimensional array data structures, such as the homogeneous, N-dimensional ndarray, and a large library of functions that operate efficiently on these data structures.

  • numpy.org

    Testing guidelines — NumPy v2.5 Manual

    The output of an interactive Python session can be included in the docstring of a function, and the test framework can run the example and compare the actual output to the expected output.

  • numpy.org

    Array creation — NumPy v2.7.dev0 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

    Standard array subclasses — NumPy v2.5 Manual

    This case arises, for example, when all array-like arguments are Python numbers or lists. (NumPy arrays do have a __array_function__ method, given below, but it always returns NotImplemented if any argument other than a NumPy array subclass implements __array_function__.)

  • numpy.org

    numpy.asarray — 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 quickstart — NumPy v2.5 Manual

    There are several ways to create arrays. For example, you can create an array from a regular Python list or tuple using the array function. The type of the ...