home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 809708107

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
809708107 MDU6SXNzdWU4MDk3MDgxMDc= 4917 Comparing against datetime.datetime and pd.Timestamp 15331990 open 0     1 2021-02-16T22:54:39Z 2021-03-25T22:18:08Z   CONTRIBUTOR      

Not sure if exactly bug and what performance implications there are but it'd be more user friendly if supported:

1.) comparing against datetime python import datetime import pandas as pd import xarray as xr ds = xr.Dataset(coords={'int': [0, 1, 2]}) ds['data'] = ('int', [0, 5, 6]) ds.coords['time'] = ('int', pd.date_range('2017-02-01', '2017-02-03')) ds = ds.where(ds['time'] > datetime.datetime(2017, 2, 2)) ds

TypeError: '>' not supported between instances of 'int' and 'datetime.datetime'

2.) pd.Timestamp python import datetime import pandas as pd import xarray as xr ds = xr.Dataset(coords={'int': [0, 1, 2]}) ds['data'] = ('int', [0, 5, 6]) ds.coords['time'] = ('int', pd.date_range('2017-02-01', '2017-02-03')) ds = ds.where(ds['time'] > pd.to_datetime('2017-02-02')) ds

This works though when converting to np.datetime64 python import datetime import pandas as pd import xarray as xr ds = xr.Dataset(coords={'int': [0, 1, 2]}) ds['data'] = ('int', [0, 5, 6]) ds.coords['time'] = ('int', pd.date_range('2017-02-01', '2017-02-03')) ds = ds.where(ds['time'] > pd.to_datetime(['2017-02-02']).values) ds

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4917/reactions",
    "total_count": 3,
    "+1": 3,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 0.574ms · About: xarray-datasette