{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/12669","repository_url":"https://api.github.com/repos/pydata/pandas","labels_url":"https://api.github.com/repos/pydata/pandas/issues/12669/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/12669/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/12669/events","html_url":"https://github.com/pydata/pandas/issues/12669","id":142026720,"number":12669,"title":"ERR: better error message on invalid window when using .rolling","user":{"login":"anntzer","id":1322974,"avatar_url":"https://avatars.githubusercontent.com/u/1322974?v=3","gravatar_id":"","url":"https://api.github.com/users/anntzer","html_url":"https://github.com/anntzer","followers_url":"https://api.github.com/users/anntzer/followers","following_url":"https://api.github.com/users/anntzer/following{/other_user}","gists_url":"https://api.github.com/users/anntzer/gists{/gist_id}","starred_url":"https://api.github.com/users/anntzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anntzer/subscriptions","organizations_url":"https://api.github.com/users/anntzer/orgs","repos_url":"https://api.github.com/users/anntzer/repos","events_url":"https://api.github.com/users/anntzer/events{/privacy}","received_events_url":"https://api.github.com/users/anntzer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pydata/pandas/labels/Difficulty%20Novice","name":"Difficulty Novice","color":"fbca04"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Effort%20Low","name":"Effort Low","color":"006b75"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Error%20Reporting","name":"Error Reporting","color":"ffa0ff"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Reshaping","name":"Reshaping","color":"02d7e1"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/pydata/pandas/milestones/38","html_url":"https://github.com/pydata/pandas/milestones/0.18.1","labels_url":"https://api.github.com/repos/pydata/pandas/milestones/38/labels","id":1570594,"number":38,"title":"0.18.1","description":"after 0.18.0 of course!","creator":{"login":"jreback","id":953992,"avatar_url":"https://avatars.githubusercontent.com/u/953992?v=3","gravatar_id":"","url":"https://api.github.com/users/jreback","html_url":"https://github.com/jreback","followers_url":"https://api.github.com/users/jreback/followers","following_url":"https://api.github.com/users/jreback/following{/other_user}","gists_url":"https://api.github.com/users/jreback/gists{/gist_id}","starred_url":"https://api.github.com/users/jreback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jreback/subscriptions","organizations_url":"https://api.github.com/users/jreback/orgs","repos_url":"https://api.github.com/users/jreback/repos","events_url":"https://api.github.com/users/jreback/events{/privacy}","received_events_url":"https://api.github.com/users/jreback/received_events","type":"User","site_admin":false},"open_issues":164,"closed_issues":58,"state":"open","created_at":"2016-02-08T15:29:59Z","updated_at":"2016-03-25T19:28:40Z","due_on":"2016-04-26T04:00:00Z","closed_at":null},"comments":3,"created_at":"2016-03-19T04:54:25Z","updated_at":"2016-03-25T22:27:17Z","closed_at":null,"body":"```\r\nIn [15]: pd.DataFrame(np.arange(10)).rolling(2., center=True).median()\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n<ipython-input-15-73c4e557093d> in <module>()\r\n----> 1 pd.DataFrame(np.arange(10)).rolling(2., center=True).median()\r\n\r\n/usr/lib/python3.5/site-packages/pandas/core/window.py in median(self, **kwargs)\r\n    811     @Appender(_shared_docs['median'])\r\n    812     def median(self, **kwargs):\r\n--> 813         return super(Rolling, self).median(**kwargs)\r\n    814 \r\n    815     @Substitution(name='rolling')\r\n\r\n/usr/lib/python3.5/site-packages/pandas/core/window.py in median(self, how, **kwargs)\r\n    592         if self.freq is not None and how is None:\r\n    593             how = 'median'\r\n--> 594         return self._apply('roll_median_c', how=how, **kwargs)\r\n    595 \r\n    596     _shared_docs['std'] = dedent(\"\"\"\r\n\r\n/usr/lib/python3.5/site-packages/pandas/core/window.py in _apply(self, func, window, center, check_minp, how, **kwargs)\r\n    473             # calculation function\r\n    474             if center:\r\n--> 475                 offset = _offset(window, center)\r\n    476                 additional_nans = np.array([np.NaN] * offset)\r\n    477 \r\n\r\n/usr/lib/python3.5/site-packages/pandas/core/window.py in _offset(window, center)\r\n   1356 def _offset(window, center):\r\n   1357     if not com.is_integer(window):\r\n-> 1358         window = len(window)\r\n   1359     offset = (window - 1) / 2. if center else 0\r\n   1360     try:\r\n\r\nTypeError: object of type 'float' has no len()\r\n```\r\nNote that `pd.DataFrame(np.arange(10)).rolling(2.).median()` works fine.\r\n\r\npandas 0.18.0.\r\n"},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/201551829","html_url":"https://github.com/pydata/pandas/issues/12669#issuecomment-201551829","issue_url":"https://api.github.com/repos/pydata/pandas/issues/12669","id":201551829,"user":{"login":"anntzer","id":1322974,"avatar_url":"https://avatars.githubusercontent.com/u/1322974?v=3","gravatar_id":"","url":"https://api.github.com/users/anntzer","html_url":"https://github.com/anntzer","followers_url":"https://api.github.com/users/anntzer/followers","following_url":"https://api.github.com/users/anntzer/following{/other_user}","gists_url":"https://api.github.com/users/anntzer/gists{/gist_id}","starred_url":"https://api.github.com/users/anntzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anntzer/subscriptions","organizations_url":"https://api.github.com/users/anntzer/orgs","repos_url":"https://api.github.com/users/anntzer/repos","events_url":"https://api.github.com/users/anntzer/events{/privacy}","received_events_url":"https://api.github.com/users/anntzer/received_events","type":"User","site_admin":false},"created_at":"2016-03-25T22:27:17Z","updated_at":"2016-03-25T22:27:17Z","body":"I'm also in favor of requiring ints too."}}