On Tue, Jun 7, 2011 at 4:47 PM, Dave Hirschfeld
wrote:
> Mark Wiebe gmail.com> writes:
>
> >
> > >>> a = np.datetime64('today')
> >
> > >>> a - a.astype('M8[Y]')
> >
> > numpy.timedelta64(157,'D')
> >
> > vs
> >
> >
> > >>> a = np.datetime64('today')
> > >>> a - a.astype('M8[Y]')
> > Traceback (m
Mark Wiebe gmail.com> writes:
>
> >>> a = np.datetime64('today')
>
> >>> a - a.astype('M8[Y]')
>
> numpy.timedelta64(157,'D')
>
> vs
>
>
> >>> a = np.datetime64('today')
> >>> a - a.astype('M8[Y]')
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: ufunc subtract can
The NEP for datetime specifies a set of rules for how units should behave
when combined with + or -. After playing around with the implementation a
bit, I think the rules need to be changed. First, subtracting two
datetime64's should produce the more precise unit. This allows things like
the follow