<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 3, 2013 at 6:06 AM, Daniele Nicolodi <span dir="ltr"><<a href="mailto:daniele@grinta.net" target="_blank">daniele@grinta.net</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
sorry, I don't know where exactly jump in in the thread, it is getting<br>
quite long and articulated...<br>
<div class="im"><br>
On 02/10/2013 21:19, Charles R Harris wrote:<br>
> The main problem I had was deciding what arg{max, min} should return as<br>
> the return value is an integer. I like your suggestion of returning 0.<br>
<br>
</div>What about returning -1? It is still an integer (on my numpy version the<br>
return value is a signed integer), it still has the property that<br>
a[np.argmin(a)] == nan for a of only nans, but it is easily identifiable<br>
as an anomalous return value if needed.<br>
<div class="im"><br></div></blockquote><div><br></div><div>This actually makes a lot of sense. We would never return -1 for any other reason. And if it is used for indexing anywhere else, that's (mostly) ok. A problem might occur if the indexes gathered from this function are then used to define slices. But I can't really convince myself that it would be all that terrible in that case, too. Documentation will be paramount here.<br>

<br></div><div>Ben Root<br></div></div></div></div>