Created
March 21, 2024 13:55
-
-
Save lucassm/5367649033551bc7d0bd0e2ff6d8ffd5 to your computer and use it in GitHub Desktop.
Código para aplicação de valores absolutos dos perfis de carga nos dataframes da rede instanciada pelo pandapower.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# define a function to apply absolute values | |
def apply_absolute_values(net, absolute_values_dict, case_or_time_step): | |
for elm_param in absolute_values_dict.keys(): | |
# i.e elm_param = ('load', 'p_mw') | |
if absolute_values_dict[elm_param].shape[1]: | |
# get elm ('pandapower DataFrame name') and param ('pandapower DataFrame column name') | |
elm = elm_param[0] # e.i 'load' | |
param = elm_param[1] # e.i 'p_mw' | |
# apply the value in pandapower DataFrame 'elm' | |
net[elm].loc[:, param] = absolute_values_dict[elm_param].loc[case_or_time_step] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment