×

Python Tutorial

Python Basics

Python I/O

Python Operators

Python Conditions & Controls

Python Functions

Python Strings

Python Modules

Python Lists

Python OOPs

Python Arrays

Python Dictionary

Python Sets

Python Tuples

Python Exception Handling

Python NumPy

Python Pandas

Python File Handling

Python WebSocket

Python GUI Programming

Python Image Processing

Python Miscellaneous

Python Practice

Python Programs

NumPy Machine Epsilon

Learn, how to get the numpy machine epsilon format of data? By Pranit Sharma Last updated : October 08, 2023

NumPy is an abbreviated form of Numerical Python. It is used for different types of scientific operations in python. Numpy is a vast library in python which is used for almost every kind of scientific or mathematical operation. It is itself an array which is a collection of various methods and functions for processing the arrays.

Machine Epsilon in Python NumPy

Machine epsilon is suitable for double-precision numbers. We need to modify it in such a way that it also supports single precision. An easier way to get the machine epsilon for a given float type is to use a special method provided by NumPy called numpy.finfo().

Let us understand with the help of an example,

Python program to demonstrate the example of NumPy Machine Epsilon

# Import numpy
import numpy as np

# Print the machine epsilon
print("Machine epsilon:\n",np.finfo(float).eps)

Output:

Example: NumPy Machine Epsilon

Python NumPy Programs »

Advertisement
Advertisement

Comments and Discussions!

Load comments ↻


Advertisement
Advertisement
Advertisement

Copyright © 2025 www.includehelp.com. All rights reserved.