issues
1 row where repo = 13221727, state = "open" and user = 1796208 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date)
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
403378297 | MDU6SXNzdWU0MDMzNzgyOTc= | 2714 | Extra dimension on first argument passed into apply_ufunc | birdsarah 1796208 | open | 0 | 13 | 2019-01-26T00:04:47Z | 2022-05-06T03:03:00Z | NONE | Here's my code: ```python import numpy as np import xarray as xr da = xr.DataArray(np.random.rand(1000, 100)) da = da.rename({'dim_0': 'rows_a'}) db = xr.DataArray(np.random.rand(1000, 100)) db = db.rename({'dim_0': 'rows_b'}) def print_shape(a): print(a.shape) return np.zeros(shape=(a.shape[0])) def print_two_shapes(a, b): print(a.shape) print(b.shape) return np.zeros(shape=(a.shape[0], b.shape[0])) ``` If I print_shape and print_shapes with apply_ufunc I am surprised by the results: ```python xr.apply_ufunc( print_shape, da, input_core_dims=[['dim_1']] ) (1000, 100) <xarray.DataArray (rows_a: 1000)> array([0., 0., 0., ..., 0., 0., 0.]) Coordinates: * rows_a (rows_a) int64 0 1 2 3 4 5 6 7 ... 992 993 994 995 996 997 998 999 ``` vs ```python xr.apply_ufunc( print_two_shapes, da, db, input_core_dims=[['dim_1'], ['dim_1']] ) (1000, 1, 100) (1000, 100) <xarray.DataArray (rows_a: 1000, rows_b: 1000)> array([[0., 0., 0., ..., 0., 0., 0.], [0., 0., 0., ..., 0., 0., 0.], [0., 0., 0., ..., 0., 0., 0.], ..., [0., 0., 0., ..., 0., 0., 0.], [0., 0., 0., ..., 0., 0., 0.], [0., 0., 0., ..., 0., 0., 0.]]) Coordinates: * rows_a (rows_a) int64 0 1 2 3 4 5 6 7 ... 992 993 994 995 996 997 998 999 * rows_b (rows_b) int64 0 1 2 3 4 5 6 7 ... 992 993 994 995 996 997 998 999 ``` My array Maybe this is documented, but I missed it. If it is documented I'd be glad to be pointed to it and I'll see if I can come up with a suggestion of how to highlight this better in the documentation as it really threw me. |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2714/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue |
Advanced export
JSON shape: default, array, newline-delimited, object
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]);