Skip to content
murmot

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

  • numpy.org

    How to extend NumPy — NumPy v1.16 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

    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

    Indexing on ndarrays — NumPy v2.5 Manual

    For example, x[1:10:5, ::-1] can also be implemented as obj = (slice(1, 10, 5), slice(None, None, -1)); x[obj] . This can be useful for constructing generic code that works on arrays of arbitrary dimensions. See Dealing with variable numbers of indices within programs for more information.

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

  • numpy.org

    Using Python as glue — NumPy v2.5.dev0 Manual

    In this example, we will demonstrate how the addition function and the filter function implemented previously using the other approaches can be implemented using ctypes. First, the C code which implements the algorithms contains the functions zadd, dadd, sadd, cadd, and dfilter2d.

  • numpy.org

    Using Python as glue — NumPy v1.26 Manual

    In this example, we will demonstrate how the addition function and the filter function implemented previously using the other approaches can be implemented using ctypes. First, the C code which implements the algorithms contains the functions zadd, dadd, sadd, cadd, and dfilter2d.

  • numpy.org

    numpy.fromfunction — NumPy v2.1 Manual

    Shape of the output array, which also determines the shape of the coordinate arrays passed to function. ... If function returns a scalar value, the shape ...

  • numpy.org

    How to extend NumPy — NumPy v2.1 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.