So I have function that does some stuff that I need to run: TestRun(x)
I have an array of these that I want to run in a loop, but I need to define them such as df_(x) = TestRun(x). The actual code that I am trying to loop looks like the below:
df_0 = TestRun(0); df_1 = TestRun(1); df_2 = TestRun(2);
I have a few thousand of these and would like to make it simular but need some help to get it to work. Everything I have tried has failed thus far.
I was thinking something like this but it doesn't work:
x = 0
while x < int(5):
temp = "df_" + str(x) = TestRun(x)
return temp
x += 1
It's important that the scrip actually run the function as it loops through.
TestRunfunction yourself? If so, it should be namedtest_run, no? Can you share more of your code? This is odd and a bit confusing. See: minimal reproducible example.df_0using"df_" + str(x)". You will need to create adictionarynamed"dfs"for example, and dodfs[x] = TestRun(x)in the loop. 2) The moment you doreturnin a function, it ends the function, and the rest of the code (or other iterations of the loop) doesn't commit. So don't writereturnin the middle of the loop if you want the loop to continue.