[Numpy-discussion] Adding keyword to asarray and asanyarray.
ben.root at ou.edu
Fri Mar 6 09:33:43 EST 2015
On Fri, Mar 6, 2015 at 7:59 AM, Charles R Harris <charlesr.harris at gmail.com>
> Datetime64 seems to use the highest precision
> In : result_type(ones(1, dtype='datetime64[D]'), 'datetime64[us]')
> Out: dtype('<M8[us]')
> In : result_type(ones(1, dtype='datetime64[D]'), 'datetime64[Y]')
> Out: dtype('<M8[D]')
Ah, yes, that's what I'm looking for. +1 from me to have this in
asarray/asanyarray. Of course, there is always the usual caveats about
converting your datetime data in this manner, but this would be helpful in
many situations in writing functions that expect to deal with temporal data
at the resolution of minutes or somesuch.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion