home / github / issues

Menu
  • GraphQL API
  • Search all tables

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 here

np.sum(x).data

and

np.sum(x.data)

give different values when x.data is type float32.
```

Problem description

For 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 xr.show_versions()

# Paste the output here xr.show_versions() here Strangely, it says: AttributeError: module 'xarray' has no attribute 'show_versions' Perhaps I am on a very old version?
{
    "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

Links from other tables

  • 1 row from issues_id in issues_labels
  • 5 rows from issue in issue_comments
Powered by Datasette · Queries took 0.694ms · About: xarray-datasette