I create a dictionary from values I get from a database that fit certain criteria. Therefore I don’t know beforehand neither the number nor the values of the elements in the dictionary.
For example, I get something like this:
ditc1 = {"P01":{"F1":0.4,"P02":0.6}, "P02":{"F2":0.3, "P03":0.7}, "P03":{"F3":0.2, "P02":0.8}}
What I would like to do is to dynamically create mathematical equations from this elements like this:…
P01 = 0.4*F1 + 0.6*P02
P02 = 0.3*F2 + 0.7*P03
P03 = 0.2*F3 + 0.8*P02
I need the references across the equations to stay the same (e.g P02 in the first equation is P02 from the second equation), so I can solve those equations with regard to the P0X elements.
Is there a way to do this?