Skip to content
murmot

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

  • 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.array — NumPy v2.5 Manual

    Functional programming · Input and output · Indexing routines · Linear algebra ... Return an array of ones with shape and type of input. zeros_like. Return an ...

  • 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

    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

    NumPy quickstart — NumPy v2.7.dev0 Manual

    To create sequences of numbers, NumPy provides the arange function which is analogous to the Python built-in range , but returns an array. >>> np.arange(10, 30 ...

  • numpy.org

    Using Python as glue — NumPy v1.19 Manual

    Here is another example of a function that filters a two-dimensional array of double precision floating-point numbers using a fixed averaging filter.The f2py program is written in Python and can be run from inside your code to compile Fortran code at runtime, as follows

  • numpy.org

    numpy.select — NumPy v2.6.dev0 Manual

    Functional programming · Input and output · Indexing routines · numpy.c_ · numpy.r_ ... Return an array drawn from elements in choicelist, depending on conditions ...