Sep-17-2019, 05:12 AM
Hi guys,
i want to create variables in the following way:
assign a name (e.g. var1), then add the name to the prefix of the variable:
Maybe i am formulating the question in the wrong way?
Thanks for your help.
i want to create variables in the following way:
assign a name (e.g. var1), then add the name to the prefix of the variable:
name = 'var_1' this_is_+name = pd.DataFrame()the outcome i would like is having the variable renamed (on the fly) directly:
this_is_var_1 = pf.DataFrame()the error i get is
Error:File "<ipython-input-28-322e5421cff2>", line 4
df+name = pd.DataFrame()
^
SyntaxError: can't assign to operator
i tried many different way, including 'print' but it doesnt work and can't find any solution on the web.Maybe i am formulating the question in the wrong way?
Thanks for your help.