An easier way to get the machine epsilon for a given float type is to use np.finfo()
:
print(np.finfo(float).eps)
# 2.22044604925e-16
print(np.finfo(np.float32).eps)
# 1.19209e-07
More Related Contents:
- Taking subarrays from numpy array with given stride/stepsize
- Moving average or running mean
- Numpy where function multiple conditions
- Compiling numpy with OpenBLAS integration
- testing whether a Numpy array contains a given row
- Python/NumPy first occurrence of subarray
- What is the internal precision of numpy.float128?
- Limit number of threads in numpy
- python numpy ValueError: operands could not be broadcast together with shapes
- Dropping infinite values from dataframes in pandas?
- How can I add new dimensions to a Numpy array?
- Find matching rows in 2 dimensional numpy array
- itertools product speed up
- Pandas lookup from one of multiple columns, based on value
- Passing Numpy arrays to a C function for input and output
- NumPy: Pretty print tabular data
- Get year, month or day from numpy datetime64
- more efficient way to calculate distance in numpy?
- How to ‘turn off’ blurry effect of imshow() in matplotlib?
- Get coordinates of local maxima in 2D array above certain value
- Add multiple values to one numpy array index
- How to get element-wise matrix multiplication (Hadamard product) in numpy?
- How to get the indices list of all NaN value in numpy array?
- Equivalent of `polyfit` for a 2D polynomial in Python
- Combine 3 separate numpy arrays to an RGB image in Python
- Numpy Vector (N,1) dimension -> (N,) dimension conversion
- Custom data types in numpy arrays
- Python’s and Numpy’s nan and set
- numpy array TypeError: only integer scalar arrays can be converted to a scalar index
- Efficient dot products of large memory-mapped arrays