home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 274367967

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/1084#issuecomment-274367967 https://api.github.com/repos/pydata/xarray/issues/1084 274367967 MDEyOklzc3VlQ29tbWVudDI3NDM2Nzk2Nw== 6628425 2017-01-22T23:10:49Z 2017-01-22T23:12:14Z MEMBER

Thanks @shoyer. It appears using the yearfirst=True and dayfirst=False arguments fixes my first example: ```python In [9]: p._parse('0001-01-16', yearfirst=True, dayfirst=False) Out[9]: (_result(year=1, month=1, day=16), None)

In [10]: p._parse('0016-01-01', yearfirst=True, dayfirst=False) Out[10]: (_result(year=16, month=1, day=1), None) but not the second:python In [11]: p._parse('0100', yearfirst=True, dayfirst=False) Out[11]: (_result(year=100), None)

In [12]: p._parse('0001', yearfirst=True, dayfirst=False) Out[12]: (_result(day=1), None) So we might need to alter the logic a little bit if we continue with thedateutil``` approach.

I'm not super happy with using the private _parse method but I given that pandas uses it I suppose this is pretty safe. In the worse case scenario, it would be pretty easy to fork this logic from dateutil or a library with ISO-8601 parsing (e.g., Arrow).

I'm not particularly tied to one date parsing approach over another (here I was just mimicking pandas). In an ideal world, what would be your preference?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  187591179
Powered by Datasette · Queries took 237.501ms · About: xarray-datasette