Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GroupBy bug with time series #1677

Closed
wesm opened this issue Jul 25, 2012 · 3 comments
Closed

GroupBy bug with time series #1677

wesm opened this issue Jul 25, 2012 · 3 comments
Assignees
Milestone

Comments

@wesm
Copy link
Member

wesm commented Jul 25, 2012

from mailing list

a = pd.DataFrame({'dt':pd.datetime(2012,4,25,9,30,0,393000),'size':50,'price':87.67},index=[pd.datetime(2012,4,25,9,30,0,393000)])
dt = a.index[0]
minutely = pd.date_range(dt,dt,freq='5T')
grouped = a.groupby(minutely.asof)
grouped['size'].last()

# error: len() of unsized object```
@ghost ghost assigned wesm Jul 25, 2012
@timdiller
Copy link

Here is another minimal working example of a related (same?) failure. Note this runs correctly in version 0.7.3-1 and not in 0.8.x

from datetime import datetime
import numpy as np
from pandas import DataFrame, date_range

df = DataFrame(np.random.rand(100), index=date_range("1/1/2000", periods=100))
monthly_group = df.groupby(lambda x: (x.year,x.month))
try:
    print monthly_group.groups
except TypeError as e:
    print "Failed to list the groups: error was %s" % e
print monthly_group.mean()

@wesm
Copy link
Member Author

wesm commented Aug 10, 2012

That actually looks like a different bug. I've just fixed the first one but not the latter

@wesm wesm closed this as completed in 8db3848 Aug 10, 2012
@wesm
Copy link
Member Author

wesm commented Aug 10, 2012

ok fixed both of these

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants