Skip to content
murmot

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

  • numpy.org

    NumPy: the absolute basics for beginners

    reshape() will return a reshaped array without changing the data. Just remember that when you use the reshape method, the array you want to produce needs to ...

  • numpy.org

    How to extend NumPy — NumPy v2.6.dev0 Manual

    import_array(); return PyModule_Create(&moduledef); } The mymethods must be an array (usually statically declared) of PyMethodDef structures which contain method names, actual C-functions, a variable indicating whether the method uses keyword arguments or not, and docstrings.

  • 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

    Array API — NumPy v2.1 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

    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

    F2PY examples — NumPy v2.6.dev0 Manual

    This example shows a function that filters a two-dimensional array of double precision floating-point numbers using a fixed averaging filter. The advantage of using Fortran to index into multi-dimensional arrays should be clear from this example.

  • 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

    How to extend NumPy — NumPy v1.16 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: 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.arange — NumPy v2.3 Manual

    For integer arguments the function is roughly equivalent to the Python built-in range , but returns an ndarray rather than a range instance. When using a non- ...

  • 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.array2string — NumPy v2.5 Manual

    numpy.array2string# ... Return a string representation of an array. ... The output is left-padded by the length of the prefix string, and wrapping is forced at the ...

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