- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1204 Articles for Numpy
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
142 Views
To generate a Vandermonde matrix, use the np.ma.vander() method in Python Numpy. A Vandermonde matrix, named after Alexandre-Théophile Vandermonde, is a matrix with the terms of a geometric progression in each row.The columns of the output matrix are powers of the input vector. The order of the powers is determined by the increasing boolean argument. Specifically, when increasing is False, the i-th output column is the input vector raised element-wise to the power of N - i - 1. Such a matrix with a geometric progression in each row is named for Alexandre- Theophile Vandermonde.StepsAt first, import the required library ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
102 Views
To return the outer product of two masked 1D arrays, use the ma.outer() method in Python Numpy. The first parameter is the input vector. Input is flattened if not already 1-dimensional. The second parameter is the second input vector. Input is flattened if not already 1-dimensional.A masked array is the combination of a standard numpy.ndarray and a mask. A mask is either nomask, indicating that no value of the associated array is invalid, or an array of booleans that determines for each element of the associated array whether the value is valid or not.StepsAt first, import the required library −import ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
91 Views
To return the outer product of two masked arrays, use the ma.outer() method in Python Numpy. The first parameter is the input vector. Input is flattened if not already 1-dimensional. The second parameter is the second input vector. Input is flattened if not already 1-dimensional.A masked array is the combination of a standard numpy.ndarray and a mask. A mask is either nomask, indicating that no value of the associated array is invalid, or an array of booleans that determines for each element of the associated array whether the value is valid or not.StepsAt first, import the required library −import numpy ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
446 Views
To mask rows and/or columns of a 2D array that contain masked values, use the np.ma.mask_rowcols() method in Numpy. The function returns a modified version of the input array, masked depending on the value of the axis parameter.Mask whole rows and/or columns of a 2D array that contain masked values. The masking behavior is selected using the axis parameter −If axis is None, rows and columns are masked.If axis is 0, only rows are masked.If axis is 1 or -1, only columns are masked.StepsAt first, import the required library −import numpy as np import numpy.ma as maCreate an array with ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
263 Views
To compare and return True if an array is less than equal to another, use the numpy.char.less_equal() method in Python Numpy. The arr1 and arr2 are the two input string arrays of the same shape.Unlike numpy.less_equal, this comparison is performed by first stripping whitespace characters from the end of the string. This behavior is provided for backward-compatibility with numarray.The numpy.char module provides a set of vectorized string operations for arrays of type numpy.str_ or numpy.bytes_.StepsAt first, import the required library −import numpy as npCreate two One-Dimensional arrays of string −arr1 = np.array(['Cio', 'Tom', 'Cena', 'Kate', 'Adams', 'brad', 'aa']) arr2 = ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
475 Views
To compute the bit-wise XOR of two 2D arrays element-wise, use the numpy.bitwise_xor() method in Python Numpy. Computes the bit-wise XOR of the underlying binary representation of the integers in the input arrays. This ufunc implements the C/Python operator ^.The 1st and 2nd parameter are the arrays, only integer and boolean types are handled. If x1.shape != x2.shape, they must be broadcastable to a common shape.The where parameter is the condition broadcast over the input. At locations where the condition is True, the out array will be set to the ufunc result. Elsewhere, the out array will retain its original ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
120 Views
To check which element in a masked array is greater than the given value, use the ma.MaskedArray.__gt__() method. True is returned for every array element greater than the given value val. A masked array is the combination of a standard numpy.ndarray and a mask. A mask is either nomask, indicating that no value of the associated array is invalid, or an array of booleans that determines for each element of the associated array whether the value is valid or not.NumPy offers comprehensive mathematical functions, random number generators, linear algebra routines, Fourier transforms, and more. It supports a wide range of ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
255 Views
To check which element in a masked array is less than or equal to a given value, use the ma.MaskedArray.__le__() method. Returns with boolean type i.e. True and False. A masked array is the combination of a standard numpy.ndarray and a mask. A mask is either nomask, indicating that no value of the associated array is invalid, or an array of booleans that determines for each element of the associated array whether the value is valid or not.NumPy offers comprehensive mathematical functions, random number generators, linear algebra routines, Fourier transforms, and more. It supports a wide range of hardware and ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
76 Views
To check which element in a masked array is less than the given value, use the ma.MaskedArray.__lt__() method. Returns with boolean type i.e. True and False. A masked array is the combination of a standard numpy.ndarray and a mask. A mask is either nomask, indicating that no value of the associated array is invalid, or an array of booleans that determines for each element of the associated array whether the value is valid or not.NumPy offers comprehensive mathematical functions, random number generators, linear algebra routines, Fourier transforms, and more. It supports a wide range of hardware and computing platforms, and ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
95 Views
To return the variance of the masked array elements, use the ma.MaskedArray.var() in Numpy. The axis is set using the axis parameter. Returns the variance of the array elements, a measure of the spread of a distribution. The variance is computed for the flattened array by default, otherwise over the specified axis.The “axis” parameter is the axis or axes along which the variance is computed. The default is to compute the variance of the flattened array. If this is a tuple of ints, a variance is performed over multiple axes, instead of a single axis or all the axes as ... Read More