Reader small image

You're reading from  Learning NumPy Array

Product typeBook
Published inJun 2014
Reading LevelIntermediate
Publisher
ISBN-139781783983902
Edition1st Edition
Languages
Tools
Concepts
Right arrow
Author (1)
Ivan Idris
Ivan Idris
author image
Ivan Idris

Ivan Idris has an MSc in experimental physics. His graduation thesis had a strong emphasis on applied computer science. After graduating, he worked for several companies as a Java developer, data warehouse developer, and QA analyst. His main professional interests are business intelligence, big data, and cloud computing. Ivan Idris enjoys writing clean, testable code and interesting technical articles. Ivan Idris is the author of NumPy 1.5. Beginner's Guide and NumPy Cookbook by Packt Publishing.
Read more about Ivan Idris

Right arrow

Assert functions


The NumPy testing package has a number of utility functions that test whether a precondition is true or not. The following table lists the NumPy assert functions:

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learning NumPy Array
Published in: Jun 2014Publisher: ISBN-13: 9781783983902

Author (1)

author image
Ivan Idris

Ivan Idris has an MSc in experimental physics. His graduation thesis had a strong emphasis on applied computer science. After graduating, he worked for several companies as a Java developer, data warehouse developer, and QA analyst. His main professional interests are business intelligence, big data, and cloud computing. Ivan Idris enjoys writing clean, testable code and interesting technical articles. Ivan Idris is the author of NumPy 1.5. Beginner's Guide and NumPy Cookbook by Packt Publishing.
Read more about Ivan Idris

Function

Description

assert_almost_equal

This raises an exception if two numbers are not equal up to a specified precision

assert_approx_equal

This raises an exception if two numbers are not equal up to a certain significance

assert_array_almost_equal

This raises an exception if two arrays are not equal up to a specified precision

assert_array_equal

This raises an exception if two arrays are not equal

assert_array_less

This raises an exception if two arrays do not have the same shape, and the elements of the first array are strictly less than the elements of the second array

assert_equal

This raises an exception if two objects are not equal

assert_raises

This fails if a specified exception is not raised by a callable function invoked with defined arguments

assert_warns

This fails...