Skip to content
murmot

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

  • 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

    numpy.i: a SWIG Interface File for NumPy — NumPy v1.19 Manual

    For example, suppose that the rms function prototype defined above was in a header file named rms.h. To obtain the Python interface discussed above, your SWIG interface file would need the following: %{ #define SWIG_FILE_WITH_INIT #include "rms.h" %} %.

  • 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

    F2PY examples — NumPy v2.6.dev0 Manual

    python -m numpy.f2py -m add add.f. This command will produce an extension module named addmodule.c in the current directory. This extension module can now be compiled and used from Python just like any other extension module.

  • numpy.org

    numpy.ndarray.tolist — NumPy v2.1 Manual

    Return the array as an a.ndim -levels deep nested list of Python scalars. Return a copy of the array data as a (nested) Python list. Data items are converted to the nearest compatible builtin Python type, via the item function. If a.ndim is 0, then since the depth of the nested list is 0, it will not be a list at all, but a simple Python scalar.

  • 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

    numpy.select — NumPy v2.5 Manual

    numpy.select # numpy.select(condlist, choicelist, default=0) [source] # Return an array drawn from elements in choicelist, depending on conditions. Parameters: condlistlist of bool ndarrays The list of conditions which determine from which array in choicelist the output elements are taken. When multiple conditions are satisfied, the first one encountered in condlist is used. choicelistlist of ...

  • numpy.org

    numpy.select — NumPy v2.6.dev0 Manual

    The list of arrays from which the output elements are taken. It has to be of the same length as condlist. defaultarray_like, optional. The element inserted in ...

  • numpy.org

    Indexing on ndarrays — NumPy v2.5 Manual

    ndarrays can be indexed using the standard Python x [obj] syntax, where x is the array and obj the selection. There are different kinds of indexing available depending on obj: basic indexing, advanced indexing and field access. Most of the following examples show the use of indexing when referencing data in an array.

  • numpy.org

    numpy.ndarray — NumPy v2.5 Manual

    An array object represents a multidimensional, homogeneous array of fixed-size items. An associated data-type object describes the format of each element in the array (its byte-order, how many bytes it occupies in memory, whether it is an integer, a floating point number, or something else, etc.)

  • numpy.org

    numpy.arange — NumPy v2.7.dev0 Manual

    Functional programming · Input and output · Indexing routines · Linear algebra ... The type of the output array. If dtype is not given, infer the data type ...