Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
API: change .resample to be a groupby-like API #11732
Comments
jreback
added API Design Resample Difficulty Advanced Effort Medium
labels
Dec 1, 2015
jreback
added this to the
0.18.0
milestone
Dec 1, 2015
jreback
changed the title from
API: change .resample to be a groupby-like operation to API: change .resample to be a groupby-like API
Dec 1, 2015
|
This change would also eliminate the need many of the current use cases for This API will work well for downsampling (to a coarser time resolution), but it's not clear to me how it would work for upsampling or combined down/upsampling. For example, how would you upsample from daily to hourly data using forward filling with the new API? |
|
|
|
I am not sure that combined up/downsampling is even possible now? |
|
or maybe to be more in-line
(or all the above) I guess
|
|
Here's a simple example of combined up/downsampling:
|
|
I suppose we could have an optional e.g.
which I would do like: I guess |
|
POC
|
jreback
added a commit
to jreback/pandas
that referenced
this issue
Dec 23, 2015
|
|
jreback |
5b59fc0
|
jreback
added a commit
to jreback/pandas
that referenced
this issue
Feb 2, 2016
|
|
jreback |
e570570
|
jreback commentedDec 1, 2015
similar to #11603
this would transform:
s.resample('D',how='max')to
s.resample('D').max()This would be a breaking API change, as the default is
how='mean', meaning, thats.resample('D')returns themeanof the resampled data. However it would be visible at the very least and not simply change working code.This would bring
.resample(which is just a groupby type operation under the hood anyhow) into the API syntax for.groupbyand.rollinget. al.Furthermore this would allow geitem / aggregate type operations with minimal effort
e.g.
s.resample('D').agg(['min','max'])