- 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)
121 Views
To return the fractional and integral parts of array values, use the numpy.modf() method in Python Numpy. Multiply the fractional values using the index 0 values. The fractional and integral parts are negative if the given number is negative.The out is a location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned. A tuple (possible only as a keyword argument) must have length equal to the number of outputs.The condition is broadcast over the input. At locations where the condition is ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
461 Views
To return the fractional and integral parts of array values, use the numpy.modf() method in Python Numpy. The fractional and integral parts are negative if the given number is negative.The out is a location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned. A tuple (possible only as a keyword argument) must have length equal to the number of outputs.The condition is broadcast over the input. At locations where the condition is True, the out array will be set to the ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
142 Views
To reduce a multi-dimensional array, use the np.ufunc.reduce() method in Python Numpy. Here, we have used multiply.reduce() to reduce it to the multiplication of elements. The axis is set using the "axis" parameter. Axis or axes along which a reduction is performed.A universal function (or ufunc for short) is a function that operates on ndarrays in an element-byelement fashion, supporting array broadcasting, type casting, and several other standard features.That is, a ufunc is a "vectorized" wrapper for a function that takes a fixed number of specific inputs and produces a fixed number of specific outputs.StepsAt first, import the required library ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
319 Views
To test element-wise for positive or negative infinity, use the numpy.isinf() method in Python Numpy. Returns a boolean array of the same shape as x, True where x == +/-inf, otherwise False.NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic (IEEE 754). Errors result if the second argument is supplied when the first argument is a scalar, or if the first and second arguments have different shapes.StepsAt first, import the required library −import numpy as npTo test element-wise for positive or negative infinity, use the numpy.isinf() method in Python Numpy.Checking for numbers −print("Infinite? ", np.isinf(1)) print("Infinite? ", np.isinf(0))Checking for float ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
579 Views
To reduce a multi-dimensional array, use the np.ufunc.reduce() method in Python Numpy. Here, we have used multiply.reduce() to reduce it to the multiplication of elements. The axis is set using the "axis" parameter. Axis or axes along which a reduction is performed.The numpy.ufunc has functions that operate element by element on whole arrays. The ufuncs are written in C (for speed) and linked into Python with NumPy’s ufunc facility. A universal function (or ufunc for short) is a function that operates on ndarrays in an element-by-element fashion, supporting array broadcasting, type casting, and several other standard features. That is, a ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
102 Views
To test array values for finiteness, use the numpy.isfinite() method in Python Numpy. The new location where we will store the result is a new array. Returns True where x is not positive infinity, negative infinity, or NaN; false otherwise. This is a scalar if x is a scalar.This condition is 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 value. Note that if an uninitialized out array is created via the default out=None, locations within it where the condition ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
387 Views
To reduce a multi-dimensional array, use the np.ufunc.reduce() method in Python Numpy. Here, we have used add.reduce() to reduce it to the addition of elements.The numpy.ufunc has functions that operate element by element on whole arrays. The ufuncs are written in C (for speed) and linked into Python with NumPy’s ufunc facility. A universal function (or ufunc for short) is a function that operates on ndarrays in an element-by-element fashion, supporting array broadcasting, type casting, and several other standard features. That is, a ufunc is a “vectorized” wrapper for a function that takes a fixed number of specific inputs and ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
159 Views
To test array values for finiteness, use the numpy.isfinite() method in Python Numpy. Returns True where x is not positive infinity, negative infinity, or NaN; false otherwise. This is a scalar if x is a scalar.This condition is 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 value. Note that if an uninitialized out array is created via the default out=None, locations within it where the condition is False will remain uninitialized.StepsAt first, import the required library −import numpy as ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
334 Views
To compare two arrays and return the element-wise minimum ignoring NaNs, use the numpy.fmin() method in Python Numpy. Return value is either True or False.Compare two arrays and returns a new array containing the element-wise maxima. If one of the elements being compared is a NaN, then the non-nan element is returned. If both elements are NaNs then the first is returned. The latter distinction is important for complex NaNs, which are defined as at least one of the real or imaginary parts being a NaN. The net effect is that NaNs are ignored when possible.StepsAt first, import the required ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
554 Views
To compare two arrays and return the element-wise maximum, use the numpy.fmax() method in Python Numpy. Return value is either True or False.Compare two arrays and returns a new array containing the element-wise maxima. If one of the elements being compared is a NaN, then the non-nan element is returned. If both elements are NaNs then the first is returned. The latter distinction is important for complex NaNs, which are defined as at least one of the real or imaginary parts being a NaN. The net effect is that NaNs are ignored when possible.StepsAt first, import the required library −import ... Read More