-
Notifications
You must be signed in to change notification settings - Fork 12
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
update of df for multiple rows fails/not user friendly #485
Comments
AnkurArohi
changed the title
update of df fails
update of df for multiple rows fails/not user friendly
Aug 30, 2022
Hello, you can do it like that net.update_generators(id=net.get_generators().index, voltage_regulator_on=[True]*len(net.get_generators().index)) |
Thanks for your reply, Yes but I find this not user friendly, thats why i mentioned that this is not a bug, but this is according to me not an elegant way of doing it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you want to request a feature or report a bug?
What is the current behavior?
Trying to set a boolean value for all rows in generator df is difficult/leads to error
powsybl_net is powsybl network
a = powsybl_net.get_generators()
a.voltage_regulator_on = True
powsybl_net.update_generators(a)
Error
Traceback (most recent call last):
, line 2103, in _update_elements
_pp.update_network_elements_with_series(self._handle, c_df, element_type)
pypowsybl._pypowsybl.PyPowsyblError: Series 'name' is not modifiable.
Although
a.name==powsybl_net.get_generators().name
Is True for all rows
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
What is the expected behavior?
It should be easy to update column values for each row in df
something like this
powsybl_net.get_generators().loc[:,"voltage_regulator_on"] = True
User friendliness
Please tell us about your environment:
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, spectrum, etc)
(if a question doesn't apply, you can delete it)
The text was updated successfully, but these errors were encountered: