A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/3791 below:

GroupBy using TimeGrouper does not work · Issue #3791 · pandas-dev/pandas · GitHub

BUG: TimeGrouper not too friendly with other groups, e.g.

df.set_index('Date').groupby([pd.TimeGrouper('6M'),'Branch']).sum()
should work

Hi everybody,

I found two issues with TimeGrouper:

  1. TimeGrouper does not work at all:

Let's take the following example:

df = pd.DataFrame({
'Branch' : 'A A A A A B'.split(),
'Buyer': 'Carl Mark Carl Joe Joe Carl'.split(),
'Quantity': [1,3,5,8,9,3],
'Date' : [
DT.datetime(2013,1,1,13,0),
DT.datetime(2013,1,1,13,5),
DT.datetime(2013,10,1,20,0),
DT.datetime(2013,10,3,10,0),
DT.datetime(2013,12,2,12,0),
DT.datetime(2013,12,2,14,0),
]})

gr = df.groupby(pd.TimeGrouper(freq='6M'))

def testgr(df):
print df

gr.apply(testgr)

This will raise the Exception: "Exception: All objects passed were None"

  1. With previous Panda's version it was not possible to combine TimeGrouper with another criteria such as "Branch" in my case.

Thank you very much

Andy


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4