[Numpy-discussion] can't use argmin for array of timedeltas
Benjamin Root
ben.root@ou....
Thu Sep 15 19:52:48 CDT 2011
On Thu, Sep 15, 2011 at 2:49 PM, Benjamin Root <ben.root@ou.edu> wrote:
> I encountered something similar back in April or so and that it was fixed.
> The problem was that the minimum function was implemented as max(0 - a), and
> so this fails for timedelta objects that can't do this. This was fixed for
> min(), but apparently not for argmin().
>
> Ben Root
>
I did a quick fix of this issue and made it available as part of pull
request #158:
https://github.com/numpy/numpy/pull/158
I simply reused the argmax code, but flipped the arguments for the
comparison operations. This did require modifying some header files, so I
don't know how big of an issue that will be.
Cheers,
Ben Root
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110915/ec10395c/attachment.html
More information about the NumPy-Discussion
mailing list