home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 409906674

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
409906674 MDU6SXNzdWU0MDk5MDY2NzQ= 2770 xarray .count() gives -1 when it should be 1? 17547835 closed 0     5 2019-02-13T17:02:17Z 2019-04-14T00:51:59Z 2019-04-14T00:51:59Z NONE      

Data array da I'm working with looks like: <xarray.DataArray 'T' (time: 365, latitude: 256, longitude: 512)> [47841280 values with dtype=float32] Coordinates: * time (time) datetime64[ns] 1979-01-01T09:00:00 ... 1979-12-31T09:00:00 * latitude (latitude) float32 89.462944 88.766945 ... -89.462944 * longitude (longitude) float32 0.0 0.703125 ... 358.59375 359.29688

Now int(da.time.count()) gives 365 which is correct. However when I select a time coordinate da2 = da.isel(time=0) the resulting array has one time coordinate:

<xarray.DataArray 'T' (latitude: 256, longitude: 512)> [131072 values with dtype=float32] Coordinates: time datetime64[ns] 1979-01-01T09:00:00 * latitude (latitude) float32 89.462944 88.766945 ... -89.462944 * longitude (longitude) float32 0.0 0.703125 ... 358.59375 359.29688

and int(da2.time.count()) gives me -1 instead of 1. I wasn't sure if this was a bug or I wasn't selecting the coordinate properly - if this is the case how should I call the time coordinate to count it correctly?

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

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 5 rows from issue in issue_comments
Powered by Datasette · Queries took 0.713ms · About: xarray-datasette