We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
list_of_dicts = [{ 'time': pandas.to_datetime('2016-12-03 18:00:00'), 'building': 'tall', 'type': 'steel' }, { 'time': pandas.to_datetime('2016-12-03 18:00:00'), 'building': 'tall', 'type': 'brick' }] df = pandas.DataFrame(list_of_dicts) building time type 0 tall 2016-12-03 18:00:00 steel 1 tall 2016-12-03 18:00:00 brick df = df.groupby(['building', pandas.Grouper(key = 'time', freq = '1D')]) [(<pandas.tseries.resample.TimeGrouper at 0x2b1a5978aed0>, building time type 1 tall 2016-12-03 18:00:00 brick), ('building', building time type 0 tall 2016-12-03 18:00:00 steel)]
Apparently this was fixed in #3794, but I am still seeing this issue. However, this goes away if I add 1 more grouper column to it, which is strange.
df.groupby(['building', pandas.Grouper(key = 'time', freq = '1D'), 'type']) [(('tall', Timestamp('2016-12-03 00:00:00', offset='D'), 'brick'), building time type 1 tall 2016-12-03 18:00:00 brick), (('tall', Timestamp('2016-12-03 00:00:00', offset='D'), 'steel'), building time type 0 tall 2016-12-03 18:00:00 steel)]
If I give in the explicit list, it works correctly.
df.groupby([df['building'], pandas.Grouper(key = 'time', freq = '1D')]) [(('tall', Timestamp('2016-12-03 00:00:00', offset='D')), building time type 0 tall 2016-12-03 18:00:00 steel 1 tall 2016-12-03 18:00:00 brick)]
This should be the expected output by just using 'building' or even pandas.Grouper(key='building').
pd.show_versions()
pandas: 0.15.2 nose: None Cython: None numpy: 1.9.0.dev-Unknown scipy: 0.15.1 statsmodels: None IPython: 0.13.2 sphinx: 1.3.1 patsy: None dateutil: 2.4.2 pytz: 2013d bottleneck: 0.8.0 tables: None numexpr: None matplotlib: 1.4.3 openpyxl: None xlrd: None xlwt: None xlsxwriter: None lxml: None bs4: None html5lib: None httplib2: None apiclient: None rpy2: None sqlalchemy: None pymysql: None psycopg2: None
The text was updated successfully, but these errors were encountered:
you are using a pretty old version. IIRC there were some addtiional fixes. try upgrading.
Sorry, something went wrong.
No branches or pull requests
Code Sample, a copy-pastable example if possible
Problem description
Apparently this was fixed in #3794, but I am still seeing this issue. However, this goes away if I add 1 more grouper column to it, which is strange.
Expected Output
If I give in the explicit list, it works correctly.
This should be the expected output by just using 'building' or even pandas.Grouper(key='building').
Output of
pd.show_versions()
pandas: 0.15.2
nose: None
Cython: None
numpy: 1.9.0.dev-Unknown
scipy: 0.15.1
statsmodels: None
IPython: 0.13.2
sphinx: 1.3.1
patsy: None
dateutil: 2.4.2
pytz: 2013d
bottleneck: 0.8.0
tables: None
numexpr: None
matplotlib: 1.4.3
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
rpy2: None
sqlalchemy: None
pymysql: None
psycopg2: None
The text was updated successfully, but these errors were encountered: