Skip to content
murmot

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

  • numpy.org

    How to extend NumPy — NumPy v1.20 Manual

    If multiple objects should be returned then you need to return a tuple. The Py_BuildValue (format_string, c_variables…) function makes it easy to build tuples of Python objects from C variables.The function returns None and updates the output array.

  • 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: the absolute basics for beginners

    One major difference is that slice indexing of a list copies the elements into a new list, but slicing an array returns a view: an object that refers to the ...

  • numpy.org

    How to extend NumPy — NumPy v1.19 Manual

    If multiple objects should be returned then you need to return a tuple. The Py_BuildValue (format_string, c_variables…) function makes it easy to build tuples of Python objects from C variables.The function returns None and updates the output array.

  • numpy.org

    numpy.fromfunction — NumPy v2.1 Manual

    Data-type of the coordinate arrays passed to function. By default, dtype is float. likearray_like, optional. Reference object to allow the creation of arrays ...

  • numpy.org

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

    numpy.ndarray.item — NumPy v2.2 Manual

    When the data type of a is longdouble or clongdouble, item() returns a scalar array object because there is no available Python scalar that would not lose ...

  • numpy.org

    Indexing on ndarrays — NumPy v2.5 Manual

    See Assigning values to indexed arrays for specific examples and explanations on how assignments work. Note that in Python, x[(exp1, exp2, ..., expN)] is equivalent to x[exp1, exp2, ..., expN]; the latter is just syntactic sugar for the former.

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