home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 118211474

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/453#issuecomment-118211474 https://api.github.com/repos/pydata/xarray/issues/453 118211474 MDEyOklzc3VlQ29tbWVudDExODIxMTQ3NA== 1217238 2015-07-03T02:13:01Z 2015-07-03T02:13:01Z MEMBER

I agree, it's not friendly to give an error message here.

Something you could do about this -- you probably want to convert your times into the numpy datetime64 type. That makes your operations much more efficient, and would make .min() work:

ds['Times'] = ('Time', pd.to_datetime(ds['Times'], format='%Y-%m-%d_%H:%M:%S'))

You also probably want to make this Times variable the dimension variable -- that will let you select times with datetime objects or strings instead of integers: ds.swap_dims({"Times": "Time"}).

Or in one line:

ds = ds.assign(Time=pd.to_datetime(ds['Times'], format='%Y-%m-%d_%H:%M:%S')).drop('Times')

Something xray do could about this -- we could convert string/unicode arrays into the numpy object dtype prior to attempting operations like min/argmin. That way, the min operation would still work.

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