<br><br><div class="gmail_quote">On Dec 11, 2007 2:32 AM, Hans Meine <<a href="mailto:meine@informatik.uni-hamburg.de">meine@informatik.uni-hamburg.de</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Am Montag, 10. Dezember 2007 23:46:17 schrieb Timothy Hochberg:<br><div class="Ih2E3d">> > TypeError: function takes at least 2 arguments (1 given)<br>> ><br>> > (I could simulate that by passing max = maximum_value_of(
a.dtype), if<br>> > that existed, see my other mail.)<br>><br>> Why not just use minimum or maximum as needed instead of overloading clip?<br><br></div>You mean one of the following?<br>  a.clip(min = 10, max = 
numpy.finfo(a.dtype).max)<br>  a.clip(min = 10, max = numpy.iinfo(a.dtype).max)</blockquote><div><br>No. I mean:<br><br>  numpy.maximum(a, 10)<br><br>To correspond to the above example. <br><br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br>Three reasons:<br>- this is not very concise<br>- it is less efficient than specialized clip variants<br>  (not much / too important though)<br>- I would have to discriminate integral and floating point types<br><br>
How is the latter done in numpy?  Is there a good reason not to have<br>numpy.rangetraits(sometype) with min/max as in iinfo/finfo?<br>Should I use isinstance(mytype, int)?<br><font color="#888888"><br>--<br></font><div><div>
</div><div class="Wj3C7c">Ciao, /  /<br>     /--/<br>    /  / ANS<br>_______________________________________________<br>Numpy-discussion mailing list<br><a href="mailto:Numpy-discussion@scipy.org">Numpy-discussion@scipy.org
</a><br><a href="http://projects.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://projects.scipy.org/mailman/listinfo/numpy-discussion</a><br></div></div></blockquote></div><br><br clear="all"><br>-- <br>
.  __<br>.   |-\<br>.<br>.  <a href="mailto:tim.hochberg@ieee.org">tim.hochberg@ieee.org</a>