Overview:
- The numpy.isfinite() checks each element of an NumPy array-like whether it is infinite and returns a Boolean ndarray containing results. The definition of infinity here includes positive inifinity, negative inifinity and Not a Number. When the input to the function is a NumPy scalar the result is also a scalar - a Boolean value representing True or False.
Example:
# Example Python program that checks # Create an ndarray # Fill the ndarray with finite and infinite values # Find the infinite numbers |
Output:
[[3.14285714 inf] [ inf inf]] [[ True False] [False False]] |