[Numpy-discussion] Minimum and maximum values of numpy datatypes?

Travis E. Oliphant oliphant@enthought....
Mon Dec 10 11:41:06 CST 2007


Hans Meine wrote:
> Hi!
>
> Is there a way to query the minimum and maximum values of the numpy datatypes?
>   

numpy.iinfo  (notice the two i's) (integer information)
numpy.finfo (floating point information)

Example:

numpy.iinfo(numpy.uint8).max
numpy.iinfo(numpy.int16).min

You pass the datatype to the numpy.iinfo() constructor and then get 
attributes on the result..

-Travis



More information about the Numpy-discussion mailing list