Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Breaking examples due to resample refactor #12448
Comments
jreback
added API Design Resample
labels
Feb 25, 2016
jreback
added this to the
0.18.0
milestone
Feb 25, 2016
|
ok
similar / better than this
|
|
jreback
referenced
this issue
Feb 27, 2016
Closed
API: groupby.resample *maybe* can return a deferred operation #12486
jreback
added a commit
to jreback/pandas
that referenced
this issue
Mar 8, 2016
|
|
jreback |
4a49f1b
|
jreback
closed this
in 14cf67f
Mar 8, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jorisvandenbossche commentedFeb 25, 2016
While using master a bit, I discovered some more cases where the new resample API breaks things:
Plotting.
.plotis a dedicated groupby/resample method (which adds each group individually to the plot), while I think it is a very common idiom to quickly resample your timeseries and plot it with (old API) egs.resample('D').plot().Example with master:
while previously it would just have given you one continuous line.
This one can be solved I think by special casing
plotforresample(not have it a special groupby-like method, but let it warn and pass the theresample().mean()result toSeries.plot()like the 'deprecated_valids')When you previously called a method on the
resampleresult that is also a valid Resampler method now. Egs.resample(freq).min()would previously have given you the "minimum daily average" while now it will give you the "minimum per day".This one is more difficult/impossible to solve I think? As you could detect that case if you know it is old code, but cannot distinguish it from perfectly valid code with the new API. If we can't solve it, I think it deserves some mention in the whatsnew explanation.
Using
resampleon agroupbyobject (xref #12202). Using the example of that issue, with 0.17.1 you get:while with master you get:
which will give you different results/error with further operations on that. Also, this case does not raise any FutureWarning (which should, as the user should adapt the code to
groupby().resample('D').ffill())