Skip to content Skip to sidebar Skip to footer

Calling/selecting Variables (float Valued) With User Input In Python

I've been working on a computational physics project (plotting related rates of chemical reactants with respect to eachother to show oscillatory behavior) with a fair amount of suc

Solution 1:

Once you have calculated the different arrays, you could add them to a dict that maps names to arrays. This can then be used to look up the correct arrays for display_x and display_y:

named_arrays = {
  "X": array_X,
  "Y": array_Y,
  "E": array_E,
  ...
}

return (named_arrays[display_x], named_arrays[display_y])

Post a Comment for "Calling/selecting Variables (float Valued) With User Input In Python"