Skip to content
murmot

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

  • 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

    NumPy: the absolute basics for beginners

    You can use the view method to create a new array object ... By default, every NumPy aggregation function will return the aggregate of the entire array.

  • numpy.org

    Interoperability with NumPy — NumPy v2.6.dev0 Manual

    __array_interface__: a Python dictionary containing the shape, the element type, and optionally, the data buffer address and the strides of an array-like object3. Returning foreign objects. Interoperability examples. Example: Pandas Series objects. Example: PyTorch tensors.

  • numpy.org

    Interoperability with NumPy — NumPy v1.26 Manual

    Interoperability examples. Example: Pandas Series objects. Example: PyTorch tensors. Example: CuPy arrays.When NumPy functions encounter a foreign object, they will try (in order): The buffer protocol, described in the Python C-API documentation.

  • numpy.org

    Beyond the basics — NumPy v2.5.dev0 Manual

    The returned object is an array-iterator object (the same object returned by the .flat attribute of the ndarray).Very often, it is desirable to iterate over several arrays at the same time. The universal functions are an example of this kind of behavior.

  • numpy.org

    numpy.full — NumPy v2.5 Manual

    Return a new array of given shape and type, filled with fill_value. ... In this case, it ensures the creation of an array object compatible with that passed in ...

  • 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

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