Hi! Is there a way to query the minimum and maximum values of the numpy datatypes? E.g. numpy.uint8.max == 255, numpy.uint8.min == 0 (these attributes exist, but they are functions, obviously for technical reasons). Ciao, / / /--/ / / ANS
I had the same problem sooner today, someone told me the answer : use numpy.info object ;) Matthieu 2007/12/10, Hans Meine <meine@informatik.uni-hamburg.de>:
Hi!
Is there a way to query the minimum and maximum values of the numpy datatypes?
E.g. numpy.uint8.max == 255, numpy.uint8.min == 0 (these attributes exist, but they are functions, obviously for technical reasons).
Ciao, / / /--/ / / ANS _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
-- French PhD student Website : http://matthieu-brucher.developpez.com/ Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn : http://www.linkedin.com/in/matthieubrucher
Am Montag, 10. Dezember 2007 17:23:07 schrieb Matthieu Brucher:
I had the same problem sooner today, someone told me the answer : use numpy.info object ;)
I saw this shortly after posting (what a coincidence), and I planned to reply to myself, but my mail did not make it to the list very quickly.. (nearly two hours!) Thanks, that's indeed what I was looking for. -- Ciao, / / /--/ / / ANS
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
participants (3)
-
Hans Meine
-
Matthieu Brucher
-
Travis E. Oliphant