{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/11841","labels_url":"https://api.github.com/repos/pydata/pandas/issues/11841/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/11841/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/11841/events","html_url":"https://github.com/pydata/pandas/pull/11841","id":122154149,"number":11841,"title":"Refactored Resample API breaking change","user":{"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},"labels":[{"url":"https://api.github.com/repos/pydata/pandas/labels/API%20Design","name":"API Design","color":"AD7FA8"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Resample","name":"Resample","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/pydata/pandas/milestones/36","html_url":"https://github.com/pydata/pandas/milestones/0.18.0","labels_url":"https://api.github.com/repos/pydata/pandas/milestones/36/labels","id":1214851,"number":36,"title":"0.18.0","description":"","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":68,"closed_issues":225,"state":"open","created_at":"2015-07-19T20:18:45Z","updated_at":"2016-01-26T18:01:22Z","due_on":"2016-01-31T05:00:00Z","closed_at":null},"comments":47,"created_at":"2015-12-14T23:14:06Z","updated_at":"2016-01-26T18:05:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pydata/pandas/pulls/11841","html_url":"https://github.com/pydata/pandas/pull/11841","diff_url":"https://github.com/pydata/pandas/pull/11841.diff","patch_url":"https://github.com/pydata/pandas/pull/11841.patch"},"body":"on top of #11603\r\n\r\ncloses #11732\r\ncloses #12072\r\ncloses #9052 \r\n\r\nToDo:\r\n\r\n- [x] rewrite/expand main docs\r\n- [x] add aggregate section\r\n\r\nNew API\r\n```\r\nIn [4]: np.random.seed(1234)\r\n\r\nIn [5]: df = pd.DataFrame(np.random.rand(10,4),\r\n                     columns=list('ABCD'),\r\n                     index=pd.date_range('2010-01-01 09:00:00', periods=10, freq='s'))\r\n\r\nIn [6]: df\r\nOut[6]: \r\n                            A         B         C         D\r\n2010-01-01 09:00:00  0.191519  0.622109  0.437728  0.785359\r\n2010-01-01 09:00:01  0.779976  0.272593  0.276464  0.801872\r\n2010-01-01 09:00:02  0.958139  0.875933  0.357817  0.500995\r\n2010-01-01 09:00:03  0.683463  0.712702  0.370251  0.561196\r\n2010-01-01 09:00:04  0.503083  0.013768  0.772827  0.882641\r\n2010-01-01 09:00:05  0.364886  0.615396  0.075381  0.368824\r\n2010-01-01 09:00:06  0.933140  0.651378  0.397203  0.788730\r\n2010-01-01 09:00:07  0.316836  0.568099  0.869127  0.436173\r\n2010-01-01 09:00:08  0.802148  0.143767  0.704261  0.704581\r\n2010-01-01 09:00:09  0.218792  0.924868  0.442141  0.909316\r\n\r\nIn [7]: df.resample('2s')\r\nOut[7]: DatetimeIndexResampler [freq=<2 * Seconds>,axis=0,closed=left,label=left,convention=start,base=0]\r\n\r\nIn [8]: r = df.resample('2s')\r\n\r\nIn [9]: r.sum()\r\nOut[9]: \r\n                            A         B         C         D\r\n2010-01-01 09:00:00  0.971495  0.894701  0.714192  1.587231\r\n2010-01-01 09:00:02  1.641602  1.588635  0.728068  1.062191\r\n2010-01-01 09:00:04  0.867969  0.629165  0.848208  1.251465\r\n2010-01-01 09:00:06  1.249976  1.219477  1.266330  1.224904\r\n2010-01-01 09:00:08  1.020940  1.068634  1.146402  1.613897\r\n\r\nIn [10]: r[['A','B']].agg(['mean','sum'])\r\nOut[10]: \r\n                            A                   B          \r\n                         mean       sum      mean       sum\r\n2010-01-01 09:00:00  0.485748  0.971495  0.447351  0.894701\r\n2010-01-01 09:00:02  0.820801  1.641602  0.794317  1.588635\r\n2010-01-01 09:00:04  0.433985  0.867969  0.314582  0.629165\r\n2010-01-01 09:00:06  0.624988  1.249976  0.609738  1.219477\r\n2010-01-01 09:00:08  0.510470  1.020940  0.534317  1.068634\r\n```\r\n\r\nUpsampling\r\n```\r\nIn [11]: s = Series(np.arange(5,dtype='int64'),\r\n   ....:               index=date_range('2010-01-01', periods=5, freq='Q'))\r\n\r\nIn [12]: s\r\nOut[12]: \r\n2010-03-31    0\r\n2010-06-30    1\r\n2010-09-30    2\r\n2010-12-31    3\r\n2011-03-31    4\r\nFreq: Q-DEC, dtype: int64\r\n\r\nIn [13]: s.resample('M').ffill()\r\nOut[13]: \r\n2010-03-31    0\r\n2010-04-30    0\r\n2010-05-31    0\r\n2010-06-30    1\r\n2010-07-31    1\r\n2010-08-31    1\r\n2010-09-30    2\r\n2010-10-31    2\r\n2010-11-30    2\r\n2010-12-31    3\r\n2011-01-31    3\r\n2011-02-28    3\r\n2011-03-31    4\r\nFreq: M, dtype: int64\r\n\r\nIn [14]: s.resample('M').asfreq()\r\nOut[14]: \r\n2010-03-31     0\r\n2010-04-30   NaN\r\n2010-05-31   NaN\r\n2010-06-30     1\r\n2010-07-31   NaN\r\n2010-08-31   NaN\r\n2010-09-30     2\r\n2010-10-31   NaN\r\n2010-11-30   NaN\r\n2010-12-31     3\r\n2011-01-31   NaN\r\n2011-02-28   NaN\r\n2011-03-31     4\r\nFreq: M, dtype: float64\r\n```"},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/175147072","html_url":"https://github.com/pydata/pandas/pull/11841#issuecomment-175147072","issue_url":"https://api.github.com/repos/pydata/pandas/issues/11841","id":175147072,"user":{"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},"created_at":"2016-01-26T18:05:27Z","updated_at":"2016-01-26T18:05:27Z","body":"@jorisvandenbossche ok, latest push should fix everything you mentioned here (except for a couple of issues I have marked in #12140)"}}