-
Notifications
You must be signed in to change notification settings - Fork 249
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
fix clustering bug due to missing countries in n.buses #861
Conversation
I just have changed this due to the new pandas version, where .isna() was not working anymore. Which pandas version are you using? |
I am now also working on the newest pandas version and there isna() is working but it does not filter as I intended it to do. Is the implementation with |
I think to avoid any problems with pandas, we could just do |
I agree, but since the country column is of dtype string, we should rather track down where the |
The nan values came from a previous pandas version. In the latest version, those entries are just empty. But we somehow need to filter them and neither |
So basically with the newest pandas version =="na" is working as Martha did it, so I can close this PR. If pandas should decide to change again how missing values are treated, we could use something as I suggested above. |
If it only works for a particular pandas version, this should be reflected in the environment.yaml. Ideally, the minimum version should not be the very latest pandas version. We might need a workaround that works for more versions. |
The workaround could be the one I suggested. I.e. do |
or just add a |
Co-authored-by: Fabian Hofmann <fab.hof@gmx.de>
Changes proposed in this Pull Request
filter looking for empty values in n.buses.countries is not working anymore. This leads to errors later on in the
cluster_network
script. for 37 nodes, the error in the cluster script was that there are more combinations of subnetworks and countries than 37 and for higher cluster numbers this lead to a problem due to a division by 0.The CI did not catch the mistake in the current master, because we only consider one country for the test CI
Checklist
envs/environment.yaml
.config.default.yaml
.doc/configtables/*.csv
.doc/release_notes.rst
is added.