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

df.filter ValueError when going through the Pyam Tutorial #107

Closed
EmiFej opened this issue Jun 30, 2021 · 4 comments
Closed

df.filter ValueError when going through the Pyam Tutorial #107

EmiFej opened this issue Jun 30, 2021 · 4 comments

Comments

@EmiFej
Copy link
Contributor

EmiFej commented Jun 30, 2021

I was following the Pyam Tutorial when I encountered the following error:

ValueError: This IamDataFrame is empty!

When entering:

display_df = df.filter(model='XX', variable='YY', region='ZZ')
display_df.timeseries()

When I write variable = 'YY' the error appears, but if I just filter on model and region I get a table of values. Another issue I have with this is that it does not seem to filter correctly. Regardless of what model I chose to filter on, it only provides information about AIM/CGE 2.1. I have looked at the tutorial_data.csv file provided in the repository and there I can clearly see that there is a variable for Primary Energy in a given scenario, yet the error occurs if filtered by that variable.

Any thoughts as to why this error appears?

Lastly, also regarding the df.filter, when typing:
df.filter(region='World').region
this is the output:
['R5ASIA']
When it in fact should be ['World']

@danielhuppmann
Copy link
Member

Thank you for reporting this issue! I think that this might be due to an outdated pandas version - can you please check if you have pandas>=1.1 installed? Also, for the future, please report any issues related purely to pyam in the pyam repo or in the pyam Slack workspace #helpdesk channel.

@EmiFej
Copy link
Contributor Author

EmiFej commented Jun 30, 2021

Thank you for the swift response, and yes, I should have posted on the pyam repo..
My version of pandas is 1.1.4

@danielhuppmann
Copy link
Member

So I created a new pyam branch and ran CI on GitHub Actions specifically using pandas v1.1.4 - all tests pass, so I'm at a bit of a loss for what might be causing your issues.

https://github.com/danielhuppmann/pyam/runs/2950475879?check_suite_focus=true

Can we connect via the pyam Slack workspace?

@danielhuppmann
Copy link
Member

Identified the culprit and created a new issue in the pyam repo

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

2 participants