[Numpy-discussion] get a dtypes' range?

Christopher Barker Chris.Barker at noaa.gov
Fri Jun 17 13:38:22 EDT 2011


Hi all,

I'm wondering if there is a way to get the range of values a given dtype 
can hold?

essentially, I'm looking for something like sys.maxint, for for whatever 
numpy dtype I have n hand (and eps for floating point types).

I was hoping there would be something like

a_dtype.max_value
a_dtype.min_value

etc.

In this case, I have a uint16, so I can hard code it, but it would be 
nice to be able to be write the code in a more generic fashion.

-Chris




-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov



More information about the NumPy-Discussion mailing list