[Numpy-discussion] get range of numpy type

Christopher Burns cburns at berkeley.edu
Wed Jun 4 01:16:44 EDT 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://mail.python.org/pipermail/numpy-discussion/attachments/20080603/15b274e5/attachment.html>


More information about the NumPy-Discussion mailing list