Description
I used the below code in jupyterlab with xarray 0.15.1:
x = xr.DataArray(np.arange(10), dims=['x'], name='x')
a = xr.DataArray(3 + 4 * x, dims=['x'], coords={'x': x})
out = a.polyfit(dim='x', deg=1, full=True)
out
But output ERROR:
AttributeError Traceback (most recent call last)
in
1 x = xr.DataArray(np.arange(10), dims=['x'], name='x')
2 a = xr.DataArray(3 + 4 * x, dims=['x'], coords={'x': x})
----> 3 out = a.polyfit(dim='x', deg=1, full=True)
4 out
C:\ProgramData\Anaconda3\lib\site-packages\xarray\core\common.py in getattr(self, name)
231 return source[name]
232 raise AttributeError(
--> 233 "{!r} object has no attribute {!r}".format(type(self).name, name)
234 )
235
AttributeError: 'DataArray' object has no attribute 'polyfit'