Skip to content

Fix/time series interpolation is wrong 21351 #56515

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

Merged
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ff6d12f
fix: Fixes wrong doctest output in `pandas.core.resample.Resampler.in…
cbpygit Jan 2, 2024
1593af0
Resolved merge conflicts
cbpygit Jan 2, 2024
db68c2d
fix: Fixes wrong test case assumption for interpolation
cbpygit Dec 15, 2023
dd8b8d3
fix: Make sure frequency indexes are preserved with new interpolation…
cbpygit Dec 15, 2023
a04a3a2
fix: Fixes new-style up-sampling interpolation for MultiIndexes resul…
cbpygit Dec 21, 2023
efbba10
fix: Fixes wrong test case assumption when using linear interpolation…
cbpygit Jan 2, 2024
0294464
fix: Fixes wrong test case assumption when using linear interpolation…
cbpygit Jan 2, 2024
537f8bf
fix: Adds test skips for interpolation methods that require scipy if …
cbpygit Jan 2, 2024
901701c
Merge branch 'main' into fix/time-series-interpolation-is-wrong-21351
cbpygit Mar 6, 2024
4f78c75
fix: Makes sure keyword arguments "downcast" is not passed to scipy i…
cbpygit Mar 6, 2024
a5bcd45
fix: Adjusted expected warning type in `test_groupby_resample_interpo…
cbpygit Mar 6, 2024
7d4b4ce
fix: Fixes failing interpolation on groupby if the index has `name`=N…
cbpygit Mar 6, 2024
dbae717
Merge branch 'main' into fix/time-series-interpolation-is-wrong-21351
cbpygit Mar 8, 2024
05be840
Merge branch 'main' into fix/time-series-interpolation-is-wrong-21351
cbpygit Mar 12, 2024
0912249
Trigger Actions
cbpygit Mar 12, 2024
49a7c4c
Merge remote-tracking branch 'origin/fix/time-series-interpolation-is…
cbpygit Mar 12, 2024
a5a7299
Merge branch 'main' into fix/time-series-interpolation-is-wrong-21351
cbpygit Mar 14, 2024
6a6fa88
Merge branch 'main' into fix/time-series-interpolation-is-wrong-21351
cbpygit Mar 15, 2024
4ebed74
Merge branch 'main' into fix/time-series-interpolation-is-wrong-21351
MarcoGorelli Mar 20, 2024
0ee5b8d
feat: Raise error on attempt to interpolate a MultiIndex data frame, …
cbpygit Apr 2, 2024
b2bc373
Merge branch 'main' into fix/time-series-interpolation-is-wrong-21351
cbpygit Apr 2, 2024
6109102
Merge branch 'main' into fix/time-series-interpolation-is-wrong-21351
cbpygit Apr 3, 2024
d6af64a
Apply suggestions from code review
cbpygit Apr 4, 2024
2a86a27
refactor: Adjusted error type assertion in test case
cbpygit Apr 4, 2024
9c90e23
refactor: Removed unused parametrization definitions and switched to …
cbpygit Apr 4, 2024
4b2f3dc
fix: Adds forgotten "@" before pytest.mark.parametrize
cbpygit Apr 4, 2024
d11c162
Merge branch 'main' into fix/time-series-interpolation-is-wrong-21351
cbpygit Apr 4, 2024
789c511
refactor: Apply suggestions from code review
cbpygit Apr 4, 2024
4f6d102
refactor: Switched to ficture params syntax for test case parametriza…
cbpygit Apr 4, 2024
c0547b5
Merge branch 'main' into fix/time-series-interpolation-is-wrong-21351
cbpygit Apr 7, 2024
d6382f8
Merge branch 'main' into fix/time-series-interpolation-is-wrong-21351
cbpygit Apr 9, 2024
4e9a616
Update pandas/tests/resample/test_time_grouper.py
cbpygit Apr 13, 2024
c655bf1
Update pandas/tests/resample/test_base.py
cbpygit Apr 13, 2024
e916da9
Merge branch 'main' into fix/time-series-interpolation-is-wrong-21351
cbpygit Apr 14, 2024
eaa7e07
refactor: Fixes too long line
cbpygit Apr 14, 2024
649bfa2
tests: Fixes test that fails due to unimportant index name comparison
cbpygit Apr 14, 2024
4cfbbf1
docs: Added entry in whatsnew
cbpygit Apr 24, 2024
76794e3
Empty-Commit
cbpygit Apr 24, 2024
6ad9b26
Merge branch 'main' into fix/time-series-interpolation-is-wrong-21351
cbpygit Apr 24, 2024
6555141
Empty-Commit
cbpygit Apr 24, 2024
48850cc
Empty-Commit
cbpygit Apr 24, 2024
8eea71c
Merge branch 'main' into fix/time-series-interpolation-is-wrong-21351
cbpygit Apr 24, 2024
7f957cf
docs: Sorted whatsnew
cbpygit Apr 24, 2024
51e95e0
Merge remote-tracking branch 'origin/fix/time-series-interpolation-is…
cbpygit Apr 24, 2024
12bdd90
docs: Adjusted bug fix note and moved it to the right section
cbpygit Apr 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: Make sure frequency indexes are preserved with new interpolation…
… approach
  • Loading branch information
cbpygit committed Jan 2, 2024
commit dd8b8d39dd19e56772e20c26188731c373e28c11
6 changes: 5 additions & 1 deletion pandas/core/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,11 @@ def interpolate(
# resampled index are removed
if is_period_index:
return result_interpolated
return result_interpolated.loc[final_index]

result_interpolated = result_interpolated.loc[final_index]
# This is to make sure that frequency indexes are preserved
result_interpolated.index = final_index
return result_interpolated

@final
def asfreq(self, fill_value=None):
Expand Down