home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 436679811

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/2547#issuecomment-436679811 https://api.github.com/repos/pydata/xarray/issues/2547 436679811 MDEyOklzc3VlQ29tbWVudDQzNjY3OTgxMQ== 6628425 2018-11-07T16:14:27Z 2018-11-07T16:14:27Z MEMBER

Thanks @tommylees112 -- note that the reindex and ffill methods do not operate in-place, so you'll need to assign the results of them to new variables. You can also do them all in one step: ``` In [1]: import xarray as xr; import pandas as pd; import numpy as np

In [2]: ds = xr.open_dataset('Rg_dummy.nc')

In [3]: times = pd.date_range("2000-01-01", "2000-12-31", name="time")

In [4]: ds['time'] = np.array([times[0]])

In [5]: ds2 = ds.reindex(time=times, method='ffill')

In [6]: ds2.to_netcdf('result.nc') ``` Regarding the issue saving to files -- I can reproduce that issue with older xarray versions. It is related to

2512 and was fixed in #2513 (i.e. it works with the master version of xarray). The good news is this bug only applies to saving ds in my example, not ds2, so you should be able to do this with your current setup just fine.

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