Skip to content

Commit fe9e310

Browse files
committed
ENH: Raise useful error when iterating a Window
Until Issue pandas-dev#11704 is completed, raise a NotImplementedError to provide a more clear error message when attempting to iterate over a Rolling or Expanding window.
1 parent eff1faf commit fe9e310

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/core/window.py

+4
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ def __unicode__(self):
181181
return "{klass} [{attrs}]".format(klass=self._window_type,
182182
attrs=','.join(attrs))
183183

184+
def __iter__(self):
185+
url = 'https://github.com/pandas-dev/pandas/issues/11704'
186+
raise NotImplementedError('See issue #11704 %s' % (url,))
187+
184188
def _get_index(self, index=None):
185189
"""
186190
Return index as ndarrays

0 commit comments

Comments
 (0)