Calling/selecting variables (float valued) with user input in Python

前端 未结 1 1101
梦谈多话
梦谈多话 2021-01-27 01:17

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

相关标签:
1条回答
  • 2021-01-27 02:01

    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])
    
    0 讨论(0)
提交回复
热议问题