Skip to content
murmot

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

  • numpy.org

    numpy.ravel — NumPy v2.7.dev0 Manual

    ... returned array will have the same type as the input array. (for example, a masked array will be returned for a masked array input). Parameters: aarray_like.

  • 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

    Array objects — NumPy v2.5 Manual

    In addition to basic types (integers, floats, etc.), the data type objects can also represent data structures. An item extracted from an array, e.g., by indexing, is represented by a Python object whose type is one of the array scalar types built in NumPy. The array scalars allow easy manipulation of also more complicated arrangements of data.

  • numpy.org

    numpy.arange — NumPy v2.7.dev0 Manual

    For integer arguments the function is roughly equivalent to the Python ... In this case, it ensures the creation of an array object compatible with that passed in ...

  • numpy.org

    numpy.array — NumPy v2.1 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

    Data types — NumPy v2.5 Manual

    Note that, above, we could have used the Python float object as a dtype instead of numpy. ... This means that storing an array of byte sequences or strings using ...

  • numpy.org

    Beyond the basics — NumPy v2.2 Manual

    The returned object is an array-iterator object (the same object returned by the .flat attribute of the ndarray).Iterating over multiple arrays#. 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.array — NumPy v2.7.dev0 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

    Python types and C-structures — NumPy v2.3 Manual

    A pointer to a function that returns a standard Python object from a single element of the array object arr pointed to by data.This is an iterator object that makes it easy to loop over an N-dimensional array. It is the object returned from the flat attribute of an ndarray.

  • numpy.org

    NumPy User Guide

    For example, you can create an array from a regular Python list or tuple using the array function. The type of the resulting array is deduced from the type of the elements in the sequences.

  • numpy.org

    New functions — NumPy v2.6.dev0 Manual

    The reduction returns one array per output. See Adding a reduction loop to a ufunc for a worked example. (gh-31816).np.strings.partition and np.strings.rpartition now accept a Python str or fixed-width unicode separator when operating on StringDType arrays.

  • numpy.org

    Array creation — NumPy v1.20 Manual

    Jan 31, 2021 · In general, numerical data arranged in an array-like structure in Python can be converted to arrays through the use of the array () function. The most obvious examples are lists and tuples. See the documentation for array () for details for its use. Some objects may support the array-protocol and allow conversion to arrays this way.

  • numpy.org

    Universal functions (ufunc) basics — NumPy v2.5 Manual

    In NumPy, universal functions are instances of the numpy.ufunc class. Many of the built-in functions are implemented in compiled C code. The basic ufuncs operate on scalars, but there is also a generalized kind for which the basic elements are sub-arrays (vectors, matrices, etc.), and broadcasting is done over other dimensions. The simplest example is the addition operator: