Skip to content

Tag Archives: Python numpy-ndarray

In this article, we will discuss how to get the number of dimensions of a matrix using NumPy. It can be found using the ndim… Read More
numpy.require() function is useful for the array when correct flags is returned satisfies requirements for passing to compiled code (perhaps through ctypes). Syntax: numpy.require(a, dtype=None,… Read More
In this article we will learn about checking a specified row is in NumPy array or not. If the given list is present in a… Read More
In numpy, we can check that whether none of the elements of given array is zero or not with the help of numpy.all() function. In… Read More
It’s sometimes required to convert a dictionary in Python into a NumPy array and Python provides an efficient method to perform this operation. Converting a… Read More
numpy.who(vardict=None) function prints the Numpy ndarrays in the given dictionary. If there is no dictionary passed in or vardict is None then prints NumPy arrays… Read More
In NumPy, we can find Einstein’s summation convention of two given multidimensional arrays with the help of numpy.einsum(). We will pass two arrays as a… Read More
Prerequisite: Python List, Numpy ndarray Both lists and NumPy arrays are inter-convertible. Since NumPy is a fast (High-performance) Python library for performing mathematical operations so… Read More
numpy.interp() function returns the one-dimensional piecewise linear interpolant to a function with given discrete data points (xp, fp), evaluated at x. Syntax : numpy.interp(x, xp,… Read More
numpy.indices() function return an array representing the indices of a grid. Compute an array where the subarrays contain index values 0, 1, … varying only… Read More
numpy.ndarray.dtype() function return the data-type of the array’s elements. Syntax : numpy.ndarray.dtype() Parameters : None Return : [numpy dtype object] Return the data-type of the… Read More
numpy.ndarray.resize() function change shape and size of array in-place. Syntax : numpy.ndarray.resize(new_shape, refcheck = True) Parameters : new_shape :[tuple of ints, or n ints] Shape… Read More function return the dot product of two arrays. Syntax :, out=None) Parameters : arr : [array_like] Input array. out : [ndarray, optional] Output… Read More
numpy.ndarray.flatten() function return a copy of the array collapsed into one dimension. Syntax : numpy.ndarray.flatten(order=’C’) Parameters : order : [{‘C’, ‘F’, ‘A’, ‘K’}, optional] ‘C’… Read More
numpy.ndarray.transpose() function returns a view of the array with axes transposed. For a 1-D array this has no effect, as a transposed vector is simply… Read More