[Numpy-discussion] get range of numpy type

Christopher Burns cburns@berkeley....
Wed Jun 4 00:16:44 CDT 2008


Is there a way to get the range of a numpy type?  I'd like to clamp a
parameter to be within the range of a numpy type, np.uint8, np.uint32...

Something like:
if x > max_value_of(np.uint8):
   x = max_value_of(np.uint8)


-- 
Christopher Burns
Computational Infrastructure for Research Labs
10 Giannini Hall, UC Berkeley
phone: 510.643.4014
http://cirl.berkeley.edu/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080603/15b274e5/attachment.html 


More information about the Numpy-discussion mailing list