home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 375914656

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/pull/2015#issuecomment-375914656 https://api.github.com/repos/pydata/xarray/issues/2015 375914656 MDEyOklzc3VlQ29tbWVudDM3NTkxNDY1Ng== 10050469 2018-03-24T18:30:17Z 2018-03-24T18:30:17Z MEMBER

The problem comes from a weird numpy casting behavior. Consider:

```python In [1]: import numpy as np

In [2]: (np.int32(2) * np.int64(2)).dtype Out[2]: dtype('int64')

In [3]: (np.array(np.int32(2)) * np.int64(2)).dtype Out[3]: dtype('int64')

In [4]: (np.array([np.int32(2)]) * np.int64(2)).dtype Out[4]: dtype('int32') ```

In the offending line:

python flat_num_dates * _NS_PER_TIME_DELTA[delta] flat_num_dates is an array of dtype int32 and _NS_PER_TIME_DELTA[delta] is a scalar of dtype int64. Is there a way to make sure this line casts to a secure dtype better than my proposed solution to cast everything to a float64 first?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  308284379
Powered by Datasette · Queries took 0.54ms · About: xarray-datasette