I am creating a dictionaries that need condition inside. So here, I have an arr_temp
holding some values, and I want to set paired_vals according to element in arr_temp
(now works only for one case).
I tried if
statement, but facing an error that I can't use elif
inside a comprehension. For now I'm just adding paired_vals_mass
everywhere, but it's wrong for my situation, because I have several values that complement each element in arr_temp
.
Can anyone suggest a good way to implement that?
report['conditions'][condname] =
{findings: [{'name': x, 'parameters': paired_vals_mass} for x in arr_temp]}