You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix/time series interpolation is wrong 21351 (#56515)
* fix: Fixes wrong doctest output in `pandas.core.resample.Resampler.interpolate` and the related explanation about consideration of anchor points when interpolating downsampled series with non-aligned result index.
* Resolved merge conflicts
* fix: Fixes wrong test case assumption for interpolation
Fixes assumption in `test_interp_basic_with_non_range_index`. If the index is [1, 2, 3, 5] and values are [1, 2, np.nan, 4], it is wrong to expect that interpolation will result in 3 for the missing value in case of linear interpolation. It will rather be 2.666...
* fix: Make sure frequency indexes are preserved with new interpolation approach
* fix: Fixes new-style up-sampling interpolation for MultiIndexes resulting from groupby-operations
* fix: Fixes wrong test case assumption when using linear interpolation on series with datetime index using business days only (test case `pandas.tests.series.methods.test_interpolate.TestSeriesInterpolateData.test_interpolate`).
* fix: Fixes wrong test case assumption when using linear interpolation on irregular index (test case `pandas.tests.series.methods.test_interpolate.TestSeriesInterpolateData.test_nan_irregular_index`).
* fix: Adds test skips for interpolation methods that require scipy if scipy is not installed
* fix: Makes sure keyword arguments "downcast" is not passed to scipy interpolation methods that are not using `interp1d` or spline.
* fix: Adjusted expected warning type in `test_groupby_resample_interpolate_off_grid`.
* fix: Fixes failing interpolation on groupby if the index has `name`=None. Adds this check to an existing test case.
* Trigger Actions
* feat: Raise error on attempt to interpolate a MultiIndex data frame, providing a useful error message that describes a working alternative syntax. Fixed related test cases and added test that makes sure the error is raised.
* Apply suggestions from code review
Co-authored-by: Matthew Roeschke <[email protected]>
* refactor: Adjusted error type assertion in test case
* refactor: Removed unused parametrization definitions and switched to direct parametrization for interpolation methods in tests.
* fix: Adds forgotten "@" before pytest.mark.parametrize
* refactor: Apply suggestions from code review
* refactor: Switched to ficture params syntax for test case parametrization
* Update pandas/tests/resample/test_time_grouper.py
Co-authored-by: Matthew Roeschke <[email protected]>
* Update pandas/tests/resample/test_base.py
Co-authored-by: Matthew Roeschke <[email protected]>
* refactor: Fixes too long line
* tests: Fixes test that fails due to unimportant index name comparison
* docs: Added entry in whatsnew
* Empty-Commit
* Empty-Commit
* Empty-Commit
* docs: Sorted whatsnew
* docs: Adjusted bug fix note and moved it to the right section
---------
Co-authored-by: Marco Edward Gorelli <[email protected]>
Co-authored-by: Matthew Roeschke <[email protected]>
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v3.0.0.rst
+1
Original file line number
Diff line number
Diff line change
@@ -438,6 +438,7 @@ Groupby/resample/rolling
438
438
- Bug in :meth:`.DataFrameGroupBy.groups` and :meth:`.SeriesGroupby.groups` that would not respect groupby argument ``dropna`` (:issue:`55919`)
439
439
- Bug in :meth:`.DataFrameGroupBy.median` where nat values gave an incorrect result. (:issue:`57926`)
440
440
- Bug in :meth:`.DataFrameGroupBy.quantile` when ``interpolation="nearest"`` is inconsistent with :meth:`DataFrame.quantile` (:issue:`47942`)
441
+
- Bug in :meth:`.Resampler.interpolate` on a :class:`DataFrame` with non-uniform sampling and/or indices not aligning with the resulting resampled index would result in wrong interpolation (:issue:`21351`)
441
442
- Bug in :meth:`DataFrame.ewm` and :meth:`Series.ewm` when passed ``times`` and aggregation functions other than mean (:issue:`51695`)
442
443
- Bug in :meth:`DataFrameGroupBy.apply` that was returning a completely empty DataFrame when all return values of ``func`` were ``None`` instead of returning an empty DataFrame with the original columns and dtypes. (:issue:`57775`)
0 commit comments