home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

1 row where type = "issue" and user = 56926399 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date), closed_at (date)

type 1

  • issue · 1 ✖

state 1

  • closed 1

repo 1

  • xarray 1
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
677773328 MDU6SXNzdWU2Nzc3NzMzMjg= 4338 Combining tiled data sets in xarray nicholaskgeorge 56926399 closed 0     4 2020-08-12T15:12:39Z 2020-08-13T12:04:11Z 2020-08-12T22:50:33Z NONE      

I'm working on a project where I need to combine different sets of geographic image tiles into one large tile in Xarray. I am running into an issue. I've made a simplified example bellow.

```python square1 = xr.DataArray(name="box1", data=np.random.randint(5, size=(3, 2)), coords=[("x", [0,1,2]),('y',[0,1])]) square2 = xr.DataArray(name="box2", data=np.random.randint(5, size=(3, 2)), coords=[("x", [2,3,4]),('y',[0,1])]) square3 = xr.DataArray(name="box3", data=np.random.randint(5, size=(3, 2)), coords=[("x", [0,1,2]),('y',[2,3])]) square4 = xr.DataArray(name="box4", data=np.random.randint(5, size=(3, 2)), coords=[("x", [2,3,4]),('y',[2,3])])

combineddata = xr.combine_by_coords([square1,square2,square3,square4]) ``` I thought this is all you need to do it but I get this error

```python

ValueError Traceback (most recent call last) <ipython-input-57-fc5add80d55a> in <module> ----> 1 xr.combine_by_coords([square1,square2,square3,square4])

~/my-conda-envs/dem/lib/python3.8/site-packages/xarray/core/combine.py in combine_by_coords(datasets, compat, data_vars, coords, fill_value, join, combine_attrs) 713 714 # Group by data vars --> 715 sorted_datasets = sorted(datasets, key=vars_as_keys) 716 grouped_by_vars = itertools.groupby(sorted_datasets, key=vars_as_keys) 717

~/my-conda-envs/dem/lib/python3.8/site-packages/xarray/core/combine.py in vars_as_keys(ds) 502 503 def vars_as_keys(ds): --> 504 return tuple(sorted(ds)) 505 506

~/my-conda-envs/dem/lib/python3.8/site-packages/xarray/core/common.py in bool(self) 118 119 def bool(self: Any) -> bool: --> 120 return bool(self.values) 121 122 def float(self: Any) -> float:

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() ``` I am not really sure why this is not working.

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

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issues] (
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [number] INTEGER,
   [title] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [state] TEXT,
   [locked] INTEGER,
   [assignee] INTEGER REFERENCES [users]([id]),
   [milestone] INTEGER REFERENCES [milestones]([id]),
   [comments] INTEGER,
   [created_at] TEXT,
   [updated_at] TEXT,
   [closed_at] TEXT,
   [author_association] TEXT,
   [active_lock_reason] TEXT,
   [draft] INTEGER,
   [pull_request] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [state_reason] TEXT,
   [repo] INTEGER REFERENCES [repos]([id]),
   [type] TEXT
);
CREATE INDEX [idx_issues_repo]
    ON [issues] ([repo]);
CREATE INDEX [idx_issues_milestone]
    ON [issues] ([milestone]);
CREATE INDEX [idx_issues_assignee]
    ON [issues] ([assignee]);
CREATE INDEX [idx_issues_user]
    ON [issues] ([user]);
Powered by Datasette · Queries took 20.237ms · About: xarray-datasette