Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

numpy create array with infinities

>>> sample = np.matrix(np.ones((50,50)) * np.inf)
>>> sample
matrix([[ inf,  inf,  inf, ...,  inf,  inf,  inf],
    [ inf,  inf,  inf, ...,  inf,  inf,  inf],
    [ inf,  inf,  inf, ...,  inf,  inf,  inf],
    ..., 
    [ inf,  inf,  inf, ...,  inf,  inf,  inf],
    [ inf,  inf,  inf, ...,  inf,  inf,  inf],
    [ inf,  inf,  inf, ...,  inf,  inf,  inf]])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #numpy #create #array #infinities
ADD COMMENT
Topic
Name
6+4 =