dimanche 17 juillet 2016

Bring variables with increasing number in the name into a numpy array in Python


I have a big number of variables that have an increasing number in their name:

var0 = 2
var1 = 6
...
var999 = 19

Is there an easy way (maybe with a loop) to create a numpy array that contains the values of the variables as elements?

list[0] = 2
list[1] = 6
...
list[999] = 19

Aucun commentaire:

Enregistrer un commentaire