In [2]:
import numpy as np
import pandas as pd
import xarray as xr
In [3]:
data = xr.DataArray(np.arange(24).reshape(4,3,2), [('lat', [10,20,30,40]), ('lon', [10,20,30]), ('time', [2000,2001])])
In [4]:
data
Out[4]:
In [12]:
data.sel(time=slice(2000,2000))
Out[12]:
In [13]:
data2 = data*2
In [14]:
data2
Out[14]:
In [15]:
data2-data
Out[15]:
In [16]:
data
Out[16]:
In [17]:
def myfunc(x, axis=None, **kwargs):
return x/2
In [24]:
data.isel(time=[1]).std()
Out[24]:
In [14]:
data
Out[14]:
In [ ]: