-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
1 parent
661d7f0
commit 4f7cb74
Showing
7 changed files
with
239 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters