Is the following what you were looking for at the beginning?
Paul
Paul
import numpy as np ##I build a model n = 20 A = [] for i in range(n): A.append("1") A[3] = '...1' A[6] = '...1' ## The list is converted to an array A = np.array(A) loc = np.where(A == "...1") exact_loc = list(loc)[0] # Eureka