Skip to content
murmot

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

  • 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

    Array API — NumPy v1.26 Manual

    Returns an ndarray object from a Python object that exposes the __array_struct__ attribute and follows the array interface protocol. If the object does not contain this attribute then a borrowed reference to Py_NotImplemented is returned.

  • numpy.org

    Array API — NumPy v2.1 Manual

    Return -1 if an error occurs or 0 on success. Note. In general, prefer the use of PyArray_Pack when handling arbitrary Python objects. Setitem is for example ...

  • numpy.org

    Array API — NumPy v1.17 Manual

    dims – An output array that contains the shape of the array object. This array gives boundaries on any looping that will take place.The function returns -1 (without setting a Python Error) if one of the objects being assigned is not callable. Deprecated since version 1.16.

  • 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

    Array objects — NumPy v2.1 Manual

    NumPy provides an N-dimensional array type, the ndarray, which describes a collection of “items” of the same type. The items can be indexed using for example N ...