Skip to content
murmot

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

  • numpy.org

    Universal functions (ufunc) — NumPy v2.6.dev0 Manual

    The Python function max() will find the maximum over a one-dimensional array, but it will do so using a slower sequence interface. The reduce method of the maximum ufunc is much faster. Also, the max() method will not give answers you might expect for arrays with greater than one dimension.

  • 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

    NumPy quickstart — NumPy v2.5 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 quickstart — NumPy v2.6.dev0 Manual

    For example, you can create an array from a regular Python list or tuple using the array function.In NumPy, these are called “universal functions” (ufunc). Within NumPy, these functions operate elementwise on an array, producing an array as output.

  • numpy.org

    numpy.where — NumPy v2.5 Manual

    Parameters: conditionarray_like, bool Where True, yield x, otherwise yield y. x, yarray_like Values from which to choose. x, y and condition need to be broadcastable to some shape. Returns: outndarray An array with elements from x where condition is True, and elements from y elsewhere.

  • numpy.org

    Universal functions (ufunc) — NumPy v1.18 Manual

    The Python function max() will find the maximum over a one-dimensional array, but it will do so using a slower sequence interface. The reduce method of the maximum ufunc is much faster. Also, the max() method will not give answers you might expect for arrays with greater than one dimension.

  • numpy.org

    NumPy quickstart — NumPy v2.5 Manual

    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

    How to extend NumPy — NumPy v1.15 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.vectorize — NumPy v2.5 Manual

    Define a vectorized function which takes a nested sequence of objects or numpy arrays as inputs and returns a single numpy array or a tuple of numpy arrays. The vectorized function evaluates pyfunc over successive tuples of the input arrays like the python map function, except it uses the broadcasting rules of numpy.

  • numpy.org

    numpy.arange — NumPy v2.3 Manual

    For integer arguments the function is roughly equivalent to the Python ... The type of the output array. If dtype is not given, infer the data type ...

  • numpy.org

    Array creation — NumPy v2.5 Manual

    Introduction # There are 6 general mechanisms for creating arrays: Conversion from other Python structures (i.e. lists and tuples) Intrinsic NumPy array creation functions (e.g. arange, ones, zeros, etc.) Replicating, joining, or mutating existing arrays Reading arrays from disk, either from standard or custom formats Creating arrays from raw bytes through the use of strings or buffers Use of ...

  • numpy.org

    NumPy: the absolute basics for beginners — NumPy v2.5 Manual

    NumPy (Num erical Py thon) is an open source Python library that’s widely used in science and engineering. The NumPy library contains multidimensional array data structures, such as the homogeneous, N-dimensional ndarray, and a large library of functions that operate efficiently on these data structures.

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