-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
correction to get time interpolation correct #39886
Conversation
oricou
commented
Feb 18, 2021
- closes Time Series Interpolation is wrong #21351
- One test does not pass and I don't know why
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to either add a test or change current ones to show what you are changing.
Done but the "Missing-data" is still here... |
@@ -86,6 +86,8 @@ | |||
Tick, | |||
) | |||
|
|||
from pandas.core.reshape.concat import concat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your imports are in the wrong order and causing failed checks.
run > isort pandas
obj = self._selected_obj | ||
tmp = concat([obj, result]).sort_index().interpolate(method='time') | ||
tmp = tmp[result.index] | ||
result[...] = tmp[~tmp.index.duplicated(keep='first')] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are not following standard code guideines, e.g. use " instead of '.
run > black pandas
this will automatically fix these issues for you.
@@ -1816,3 +1816,14 @@ def test_resample_aggregate_functions_min_count(func): | |||
index=DatetimeIndex(["2020-03-31"], dtype="datetime64[ns]", freq="Q-DEC"), | |||
) | |||
tm.assert_series_equal(result, expected) | |||
|
|||
|
|||
def timeseries_interpolation(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will not run as a test. pytest will run all files of the form test_*.py or *_test.py
rename this test_timeseries_interpolation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I have done 90 % of the job, now I let maintainers finishing it. It should take them minutes while it would take my hours to polish the PR.
This bug has been reported 3 years ago and nobody from Pandas tried anything while a solution was proposed in the bug report. Now, 3 years after, I have done a PR. I know it is not perfect but it must be very close to what it should be. I hope it will not take 3 more years.
@attack68 It is not against you. I don't want to become a maintainers but just to help at my level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@attack68 or any one else: feel free to for from my work and to finish the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oricou open source software is contributed by the community the maintainers are donating time to review and comment and once the code meets all criteria it be merged |
Thanks @oricou for taking the time to address this issue with the PR, but since this PR has gotten stale I'm going to close for now. If anyone else is interested in taking this up, happy to reopen. |