[Numpy-discussion] Minimum and maximum values of numpy datatypes?
Travis E. Oliphant
oliphant at enthought.com
Mon Dec 10 12:41:06 EST 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