Guest User

Untitled

a guest
Jan 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. import pandas
  2. pandas.__file__
  3.  
  4. from pandas.core import window as rwindow
  5.  
  6. @Appender(rwindow.rolling.__doc__)
  7. def rolling(self, window, min_periods=None, freq=None, center=False,
  8. win_type=None, on=None, axis=0, closed=None):
  9. axis = self._get_axis_number(axis)
  10. return rwindow.rolling(self, window=window,
  11. min_periods=min_periods, freq=freq,
  12. center=center, win_type=win_type,
  13. on=on, axis=axis, closed=closed)
  14.  
  15. def rolling(obj, win_type=None, **kwds):
  16. from pandas import Series, DataFrame
  17. if not isinstance(obj, (Series, DataFrame)):
  18. raise TypeError('invalid type: %s' % type(obj))
  19.  
  20. if win_type is not None:
  21. return Window(obj, win_type=win_type, **kwds)
  22.  
  23. return Rolling(obj, **kwds)
Add Comment
Please, Sign In to add comment