[Numpy-discussion] Dates and times and Datetime64 (again)

Sankarshan Mudkavi smudkavi at uwaterloo.ca
Tue Apr 1 14:13:52 EDT 2014


I agree with that interpretation of naive as well. I'll change the proposal to reflect that. So any modifier should raise an error then? (At the risk of breaking people's code.)

The only question is, should we consider accepting the modifier and disregard it with a warning, letting the user know that this is only for temporary compatibility purposes?


As of now, it's not clear to me which of those options is better.

Cheers,
Sankarshan

On Apr 1, 2014, at 1:12 PM, Nathaniel Smith <njs at pobox.com> wrote:

> On Tue, Apr 1, 2014 at 5:22 PM, Alexander Belopolsky <ndarray at mac.com> wrote:
>> 
>> On Tue, Apr 1, 2014 at 12:10 PM, Chris Barker <chris.barker at noaa.gov> wrote:
>>> 
>>> It seems this committee of two has come to a consensus on naive -- and
>>> you're probably right, raise an exception if there is a time zone specifier.
>> 
>> 
>> Count me as +1 on naive, but consider converting garbage (including strings
>> with trailing Z) to NaT.
> 
> That's not how we handle other types, e.g.:
> 
> In [5]: a = np.zeros(1, dtype=float)
> 
> In [6]: a[0] = "garbage"
> ValueError: could not convert string to float: garbage
> 
> (Cf, "Errors should never pass silently".) Any reason why datetime64
> should be different?
> 
> -n
> 
> -- 
> Nathaniel J. Smith
> Postdoctoral researcher - Informatics - University of Edinburgh
> http://vorpus.org
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion

-- 
Sankarshan Mudkavi
Undergraduate in Physics, University of Waterloo
www.smudkavi.com






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140401/8dbb15e1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140401/8dbb15e1/attachment.sig>


More information about the NumPy-Discussion mailing list