issues: 305373563
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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 305373563 | MDU6SXNzdWUzMDUzNzM1NjM= | 1989 | Inconsistent type conversion when doing numpy.sum gvies different results | 3926049 | closed | 0 | 5 | 2018-03-15T00:19:51Z | 2020-03-14T04:24:02Z | 2020-03-14T04:24:02Z | NONE | Code Sample, a copy-pastable example if possible```python Your code herenp.sum(x).data and np.sum(x.data) give different values when x.data is type float32. Problem descriptionFor my arrays, this results in a ~1% error for the two versions. np.sum(x).data is apparently promoting the float32 array to float64 before summing. [this should explain why the current behavior is a problem and why the expected output is a better solution.] Expected Output@davidh-ssec Output of
|
{
"url": "https://api.github.com/repos/pydata/xarray/issues/1989/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
completed | 13221727 | issue |