Numpy Testing For Infinity

Description

We can use the isinf command to test a value to see if it is infinite. Note this only works for the NumPy infinity constant; Sage constant oo will not work.

Sage Cell

Code

import numpy as np
a = np.inf
b = 5
print np.isinf(a)
print np.isinf(b)

Options

none

Tags

Primary Tags:

Secondary Tags:

A list of possible tags can be found at The WeBWorK Open Problem Library. For linear algebra tags see the Curated Courses Project.

Related Cells

Any related cells go here. Provide a link to the page containing the information about the cell.

Attribute

Permalink:

Author:

Date: 15 Apr 2019 00:21

Submitted by: Zane Corbiere

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License