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
BUG: Rolling on Dataset #859
Comments
CC @jhamman |
@MaximilianR - nice catch. I originally implemented the As you mentioned, I don't think it will be difficult to build a As for the public/private point, I'm not sure what to say. I just matched the implementation of Glad you're enjoying the rolling method! |
Right, that should be private too |
Agreed, this should be pretty easy! |
This just happened to me too: In [1]: import xarray as xr
In [2]: ds = xr.open_dataset('ERA-Int-Monthly-UVSLP.nc')
In [3]: ds = ds.rolling()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-3-16ff572cfc35> in <module>()
----> 1 ds = ds.rolling()
/home/mowglie/Documents/git/xarray/xarray/core/common.py in rolling(self, min_periods, center, **windows)
507 """
508
--> 509 return self.rolling_cls(self, min_periods=min_periods,
510 center=center, **windows)
511
/home/mowglie/Documents/git/xarray/xarray/core/common.py in __getattr__(self, name)
224 return source[name]
225 raise AttributeError("%r object has no attribute %r" %
--> 226 (type(self).__name__, name))
227
228 def __setattr__(self, name, value):
AttributeError: 'Dataset' object has no attribute 'rolling_cls' |
Did this ever get fixed? |
Not fixed yet, but PRs welcome |
This looks like it's available with
dir
/ tab complete, but actually isn't:I think this could be easy to implement as an
.apply
operation? (indeed, that could be a reasonable path for a whole host of operations - i.e. try and apply them to each array in the ds?)Also, as a very narrow point, I'm not sure why
.rolling_cls
is public? Probably should be private?Finally, the Rolling implementation is pretty sweet. I've been getting my hands dirty in the pandas one recently, and that we can have something as well featured as that with so few lines of code 👍
The text was updated successfully, but these errors were encountered: