-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: in .groupby.SeriesGroupBy plot not accessible? #5102
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
Comments
Oh yeah, currently at: print pd.__version__
0.12.0-706-g8e784e7 |
This is "sort of" by design. We're trying to discourage use of forwarded methods that don't make sense. Hopefully you're not using |
Hey @cpcloud, thanks for the quick reply, and makes sense to discourage methods that don't belong. Not using in production, but testing Also, I noticed that the helpful tab auto-complete of column names was clobbered with the commit as well? Thanks again. |
That code didn't touch any autocompletion code. Can you show me an example of what you mean? |
@cpcloud there's no |
something like this: you can just forward it I think in core/groupby.py on
|
sounds good |
bonus: figured out the groupby double pltting issue |
Hey @jreback, thanks for explaining more—I wasn't familiar with how pandas propagates the column names to be listed like attributes on the groupby object. @cpcloud, to answer your question, I have a In [11]: df
Out[11]:
<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 30852 entries, 2013-01-01 00:00:00-06:00 to 2013-06-26 15:00:00-05:00
Data columns (total 2 columns):
kWh 30852 non-null values
meter_id 30852 non-null values
dtypes: float64(1), object(1)
In [12]: df.head()
Out[12]:
kWh meter_id
2013-01-01 00:00:00-06:00 78 TSU_151
2013-01-01 00:15:00-06:00 72 TSU_151
2013-01-01 00:30:00-06:00 78 TSU_151
2013-01-01 00:45:00-06:00 78 TSU_151
2013-01-01 01:00:00-06:00 84 TSU_151 I create groupings, like: In [18]: grp = df.groupby(df.meter_id)
In [19]: grp
Out[19]: <pandas.core.groupby.DataFrameGroupBy object at 0x10ef81ed0> And it's here where things aren't the same, as I could previously access individual columns names via In [20]: grp.kWh
Out[20]: <pandas.core.groupby.SeriesGroupBy object at 0x10ef81a90> Also, I've just noticed that also missing in groupby autocomplete are are few other helpful methods like In [21]: grp.describe()
Out[16]:
kWh
meter_id
TSU_148 count 13362.000000
mean 395.213434
std 81.315125
min 0.000000
25% 325.300000
50% 386.000000
75% 453.600000
max 666.500000
TSU_150 count 1672.000000
mean 315.579725
std 53.129335
min 62.300000
25% 280.700000
50% 293.900000
75% 339.825000
max 577.100000
TSU_151 count 15818.000000
mean 165.428246
std 49.841351
min 60.000000
25% 108.000000
50% 180.000000
75% 204.000000
max 276.000000 Continuing, after typing out all
But again, Thanks! |
@nehalecky this was just changed, rather than do an explicity ipython autocomplete its more correct to define |
But clearly this needs to be fixed so it still completes column names and describe. |
this look right?
|
we have an open issue to put |
revsied (@cploud is updating with .plot)
|
Previously, in
0.12
and earlier, I could quickly visualizegroupby
objects with a call to.plot()
. Currently in master, the.plot
method on agroupby
object raises, with following error:The text was updated successfully, but these errors were encountered: