Skip to content

Commit

Permalink
update xarray dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
manmeet3591 authored Apr 7, 2021
1 parent bd1606a commit 2112f63
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions xarray_tutorial/create_xarray_dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,24 @@
lons = np.arange(0,3,1)
foo = xr.DataArray(data, coords=[times, lats, lons], dims=["time", "lat", "lon"])
ds = xr.Dataset({
'ndvi': xr.DataArray(
data = data, # enter data here
'SWdown': xr.DataArray(
data = np.random.random(6), # enter data here
dims = ['time'],
coords = {'time': times},
attrs = {
'_FillValue': -999.9,
'units' : 'W/m2'
}
),
attrs = {'example_attr': 'this is a global attribute'}
'LWdown': xr.DataArray(
data = np.random.random(6), # enter data here
dims = ['time'],
coords = {'time': times},
attrs = {
'_FillValue': -999.9,
'units' : 'W/m2'
}
)
},
attrs = {'example_attr': 'this is a global attribute'}
)

0 comments on commit 2112f63

Please sign in to comment.