About 1,510 results
Open links in new tab
  1. NumPy: the absolute basics for beginners — NumPy v2.2 Manual

    There are often instances where we want NumPy to initialize the values of an array. NumPy offers functions like ones() and zeros(), and the random.Generator class for random number generation for that. All you need to do is pass in the number of elements you want it to generate:

  2. Array manipulation routines — NumPy v2.2 Manual

    Return a new array with the specified shape. trim_zeros (filt[, trim, axis]) Remove values along a dimension which are zero along all other. unique (ar[, return_index, return_inverse, ...]) Find the unique elements of an array. pad (array, pad_width[, mode]) Pad an array.

  3. NumPy quickstart — NumPy v2.2 Manual

    Understand the difference between one-, two- and n-dimensional arrays in NumPy; Understand how to apply some linear algebra operations to n-dimensional arrays without using for-loops; Understand axis and shape properties for n-dimensional arrays. The basics# NumPy’s main object is the homogeneous multidimensional array.

  4. numpy.array — NumPy v2.2 Manual

    numpy.array# numpy. array (object, dtype = None, *, copy = True, order = 'K', subok = False, ndmin = 0, like = None) # Create an array. Parameters: object array_like. 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 ...

  5. The N-dimensional array (ndarray) — NumPy v2.2 Manual

    As with other container objects in Python, the contents of an ndarray can be accessed and modified by indexing or slicing the array (using, for example, N integers), and via the methods and attributes of the ndarray.

  6. Mathematical functions — NumPy v2.2 Manual

    First array elements raised to powers from second array, element-wise. fmod (x1, x2, /[, out, where, casting, ...]) Returns the element-wise remainder of division.

  7. What is NumPy? — NumPy v2.2 Manual

    It is a Python library that provides a multidimensional array object, various derived objects (such as masked arrays and matrices), and an assortment of routines for fast operations on arrays, including mathematical, logical, shape manipulation, sorting, selecting, I/O, discrete Fourier transforms, basic linear algebra, basic statistical ...

  8. Broadcasting — NumPy v2.2 Manual

    The term broadcasting describes how NumPy treats arrays with different shapes during arithmetic operations. Subject to certain constraints, the smaller array is “broadcast” across the larger array so that they have compatible shapes.

  9. Iterating over arrays — NumPy v2.2 Manual

    Arrays support the iterator protocol and can be iterated over like Python lists. See the Indexing, slicing and iterating section in the Quickstart guide for basic usage and examples. The remainder of this document presents the nditer object and covers more advanced usage.

  10. Indexing on ndarrays — NumPy v2.2 Manual

    The slice operation extracts columns with index 1 and 2, (i.e. the 2nd and 3rd columns), followed by the index array operation which extracts rows with index 0, 2 and 4 (i.e the first, third and fifth rows).