How can I set infinity as an element of a matrix in python(numpy)? -


this program

import numpy n m = complex('inf') z=n.empty([2,2] , dtype = complex) z=n.array(input() , dtype = complex ) 

but in console when give 'm' input following error massage: 'nameerror: name 'm' not defined'

infinity in python can typed as:

float('inf') / float('-inf')

or number

1e500 (+inf)

-1e500 (-inf)


Comments