home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 319325871

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/1467#issuecomment-319325871 https://api.github.com/repos/pydata/xarray/issues/1467 319325871 MDEyOklzc3VlQ29tbWVudDMxOTMyNTg3MQ== 10050469 2017-08-01T09:57:42Z 2017-08-02T16:05:15Z MEMBER

Hi Matthias, I think your solution is fine. The best is simply to avoid "months" as units altogether.

If one has a "real" calendar one can also let pandas and xarray do the job:

python t = pd.date_range(start='1980-01', end='2010-12', freq='MS') target = np.random.rand(len(t), 10, 10) lat = np.arange(50, 51, 0.1) lon = np.arange(3, 4, 0.1) target_xr = xr.Dataset({'test': (['time', 'lat', 'lon'], target)}, coords={'time': ('time', t), 'lat': lat, 'lon': lon} ) target_xr.to_netcdf('test_2.nc') which creates the following time units automatically:

int64 time(time) ; time:units = "days since 1980-01-01 00:00:00" ; time:calendar = "proleptic_gregorian" ;

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