Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'DataArray' object has no attribute 'polyfit' #3902

Closed
Hossein-Madadi opened this issue Mar 27, 2020 · 2 comments
Closed

AttributeError: 'DataArray' object has no attribute 'polyfit' #3902

Hossein-Madadi opened this issue Mar 27, 2020 · 2 comments

Comments

@Hossein-Madadi
Copy link
Contributor

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'

What is the meaning of this error?!

@kmuehlbauer
Copy link
Contributor

@hoseinmadadi Implementation of polyfit (done in PR #3733) is yet unreleased. It should be available in the next release.

@Hossein-Madadi
Copy link
Contributor Author

@kmuehlbauer, thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants