I've used locals()
function and created some variables. Now I need to fetch all the variables created into a list, how should I do?
example:
column_list=[x for x in range(100)]
for i,j in enumerate(column_list):
locals()['v'+str(i)]=pd.DataFrame(['Y','N'],columns=[j])
Now, I have variables, v0 ~ v99, each of which is an independent data frame.
I need to fetch all the variables into a variable_list
So I can use for loop on all the variables:
variable_list -> [v0,v1,v2,v3,v4.v5.......]