home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 377947810

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
377947810 MDU6SXNzdWUzNzc5NDc4MTA= 2547 How do I copy my array forwards in time? 21049064 closed 0     14 2018-11-06T17:12:00Z 2019-05-19T02:49:14Z 2019-05-19T02:49:14Z NONE      

I have this xr.Dataset: <xarray.Dataset> Dimensions: (time: 1, x: 200, y: 200) Coordinates: * time (time) float64 9.505e+17 Dimensions without coordinates: x, y Data variables: Rg (time, y, x) float32 ... latitude (y, x) float64 ... longitude (y, x) float64 ... time datetime64[ns] 2000-02-14 Attributes: Conventions: CF-1.0 content: HARMONIZED WORLD SOIL DATABASE; first it was aggregated ... scaling_factor: 20

I want to copy it through time, adding the time dimension at a given daterange

Something like this: ```python times = pd.date_range('2000-01-01', '2000-12-31', name='time')

ds.time = times[0]

all_data = [ds] for i, time in enumerate(times[1:]): ds_t1 = ds.copy() ds_t1.time = time

all_data.append(ds)
ds = ds_t1

ds = xr.concat(all_data) ```

So I should have output data like: <xarray.Dataset> Dimensions: (time: 366, x: 200, y: 200) Coordinates: * time (time) float64 ... Dimensions without coordinates: x, y Data variables: Rg (time, y, x) float32 ... latitude (y, x) float64 ... longitude (y, x) float64 ... time datetime64[ns] 2000-02-14 Attributes: Conventions: CF-1.0 content: HARMONIZED WORLD SOIL DATABASE; first it was aggregated ... scaling_factor: 20

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2547/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

  • 2 rows from issues_id in issues_labels
  • 14 rows from issue in issue_comments
Powered by Datasette · Queries took 1.031ms · About: xarray-datasette