Skip to content
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

Refactor interpolate to work on pd.Series #867

Open
danielhuppmann opened this issue Jul 22, 2024 · 0 comments
Open

Refactor interpolate to work on pd.Series #867

danielhuppmann opened this issue Jul 22, 2024 · 0 comments

Comments

@danielhuppmann
Copy link
Member

The interpolate() method currently works on a wide representation of the timeseries data, and then casts the result back to the long-form _data series. It would probably be more efficient to work on a group-by of the long-format series in the first place, eliminating the need to cast to wide and back.

Also, the method raises an unexpected error if not all timeseries have a datapoint before and after the year argument, i.e., the following call for df.interpolate(2007) fails...

2005 2010
model scenario region variable unit
model_a scen_a World Primary Energy EJ/yr 3.0 6.0
Primary Energy|Coal EJ/yr 0.5 NaN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant