home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 301657312

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
301657312 MDU6SXNzdWUzMDE2NTczMTI= 1951 einsum for xarray 6815844 closed 0     1 2018-03-02T05:25:23Z 2018-03-12T06:42:08Z 2018-03-12T06:42:08Z MEMBER      

Code Sample, a copy-pastable example if possible

I sometimes want to make more flexible dot product of two data arrays, where we sum up along a part of common dimensions.

```python

Your code here

da_vals = np.arange(6 * 5 * 4).reshape((6, 5, 4)) da = DataArray(da_vals, dims=['x', 'y', 'z']) dm_vals = np.arange(6 * 4).reshape((6, 4)) dm = DataArray(dm_vals, dims=['x', 'z'])

I want something like this

da.dot(dm, 'z') # -> dimensions of the output array: ['x', 'y'] ```

It's an intermediate path of np.matmul and np.tensordot.

Is this feature sufficiently universal?

EDIT: I just noticed dask does not have einsum yet (dask/dask#732). We maybe need to wait or decide to support only numpy arrays.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1951/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 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.674ms · About: xarray-datasette