Book Image

NumPy: Beginner's Guide

By : Ivan Idris
Book Image

NumPy: Beginner's Guide

By: Ivan Idris

Overview of this book

Table of Contents (21 chapters)
NumPy Beginner's Guide Third Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
NumPy Functions' References
Index

Approximately equal arrays


The assert_approx_equal() function raises an exception if two numbers are not equal up to a certain number of significant digits. The function raises an exception triggered by the following condition:

abs(actual - expected) >= 10**-(significant - 1)