Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Learning NumPy Array
  • Toc
  • feedback
Learning NumPy Array

Learning NumPy Array

By : Ivan Idris
4 (9)
close
Learning NumPy Array

Learning NumPy Array

4 (9)
By: Ivan Idris

Overview of this book

Table of Contents (14 chapters)
close
Learning NumPy Array
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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:

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...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete