home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 1562605326

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/issues/7871#issuecomment-1562605326 https://api.github.com/repos/pydata/xarray/issues/7871 1562605326 IC_kwDOAMm_X85dI3cO 10194086 2023-05-25T09:44:31Z 2023-05-25T09:44:31Z MEMBER

xarray handles nan values and ignores them per default - so you don't need to remove them. For example: ```python import numpy as np import xarray as xr

da = xr.DataArray([1, 2, 3, np.nan]) da.mean() `` If you have precision problems - that might be because you havefloat32` values.

I don't know what goes wrong with your lon values - that is an issue in the reprojection. You could convert them to 0...360 by using

```python

lon_dim = "x" new_lon = np.mod(da[lon_dim], 360) da = da.assign_coords({lon_dim: new_lon}) da.reindex({lon_dim : np.sort(da[lon_dim])})

```

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