how do i change a variable with iterator under a for loop in python
cluster_0 to cluster_12 are just strings. they cannot be the names of arrays or matrices. Strings can only be used in print statements and string processing statements.

The correct way to define an array or matrix is as follows: call the arrays as: cluster[0] to cluster[12]

then, assign:  

  for i in range(12):
        cluster[i] = gene_list.gene[gene_list.cluster==i]


then whenever you need to print the names of these arrays, you use:  "cluster_"+str(i)