mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-04-19 08:55:15 +00:00
convert np arrys to lists before changing
This commit is contained in:
parent
a5a492b55e
commit
ac0eacb15e
@ -138,8 +138,22 @@ class EnergieManagementSystem:
|
|||||||
"Haushaltsgeraet_wh_pro_stunde": haushaltsgeraet_wh_pro_stunde,
|
"Haushaltsgeraet_wh_pro_stunde": haushaltsgeraet_wh_pro_stunde,
|
||||||
}
|
}
|
||||||
|
|
||||||
# set the first value to None so no action will be done in the current hour
|
# List output keys where the first element needs to be changed to None
|
||||||
out["Last_Wh_pro_Stunde"][0] = None
|
keys_to_modify = [
|
||||||
out["Netzeinspeisung_Wh_pro_Stunde"][0] = None
|
"Last_Wh_pro_Stunde",
|
||||||
out["Netzbezug_Wh_pro_Stunde"][0] = None
|
"Netzeinspeisung_Wh_pro_Stunde",
|
||||||
|
"Netzbezug_Wh_pro_Stunde",
|
||||||
|
]
|
||||||
|
|
||||||
|
# Loop through each key in the list
|
||||||
|
for key in keys_to_modify:
|
||||||
|
# Convert the NumPy array to a list
|
||||||
|
element_list = out[key].tolist()
|
||||||
|
|
||||||
|
# Change the first value to None
|
||||||
|
element_list[0] = None
|
||||||
|
|
||||||
|
# Assign the modified list back to the dictionary
|
||||||
|
out[key] = element_list
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
Loading…
x
Reference in New Issue
Block a user