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

Address FutureWarning from pandas in parser. #93

Closed
spjuhel opened this issue Oct 5, 2022 · 0 comments
Closed

Address FutureWarning from pandas in parser. #93

spjuhel opened this issue Oct 5, 2022 · 0 comments

Comments

@spjuhel
Copy link

spjuhel commented Oct 5, 2022

Recent versions of pandas give the following warning when parsing OECD-ICIO:

FutureWarning: Using the level keyword in DataFrame and Series aggregations is deprecated and will be removed in a future version. Use groupby instead. df.sum(level=1) should use df.groupby(level=1).sum().

Suggestion: Follow pandas' recommendation.

Example:
Replace

https://github.com/konstantinstadler/pymrio/blob/57a8d4152b10929a7f0d2946b0e797c3e846c850/pymrio/tools/ioparser.py#L1665

By

Z.loc[co_name, :] + Z.loc[agg_list, :].groupby(level="sector",axis=0).sum() 
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