issues: 435170643
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
435170643 | MDU6SXNzdWU0MzUxNzA2NDM= | 2907 | xr.dot result differs from np.dot | 29361544 | closed | 0 | 4 | 2019-04-19T13:03:34Z | 2019-04-19T17:51:45Z | 2019-04-19T17:51:44Z | NONE | Code SampleHi, shouldn't the result of xr.dot be equivalent to np.dot? In np.dot I get values of ~280, and for xr.dot I get ~1100: ```python <xarray.DataArray 'models' (model name: 4)> array([283.6939 , 283.129198, 284.671649, 284.01668 ]) Coordinates: valid_time datetime64[ns] 2019-03-15T19:00:00 lat float64 45.89 lon float64 4.683 * model name (model name) |S5 'apple' 'juice' 'banana' 'milk' <xarray.DataArray 'weights' (models: 4)>
array([0.308999, 0.191562, 0.049474, 0.449983])
Coordinates:
lat float64 45.89
lon float64 4.683
Dimensions without coordinates: models
xr.dot(weights_da, models, dims=['models', 'model name']) <xarray.DataArray ()> array(1135.532891) Coordinates: lat float64 45.89 lon float64 4.683 valid_time datetime64[ns] 2019-03-15T19:00:00 ``` Problem descriptionWhat's going on below the surface? I mean if I create the array by hand (not from the file) I can't reproduce this. I don't think it's related to the file (as the values from the file work with numpy.dot). Something related to dask? Doing np.dot on the whole array (not just this piece here) results in a MemoryError. I'm Thanks for any advice! EDIT: I also tested it on python 3.7.3. xarray 0.11.3. Same result. Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2907/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |