I'm very badly stuck, and every pythonista I've asked can't seem to help.
I'm using vstack to create an array of vectors in a loop like this:
Corr = np.vstack((Corr, S))
I need to remove repeating vectors so that it is an array of unique vectors and to compare all of these vectors.
I know that this comparison can be done in lists, but I have not found a way to append full vectors to a list.
This is the result (I've marked unique vectors with unique letters):
Corr = [[ 0. 0. 0. 0. -2. 4. 4. 2. 2.] #a
[-4. -4. -4. -4. 2. 4. 4. 2. 2.]#b
[-4. 0. 0. 4. -2. 0. 0. -2. 2.]#c
[ 0. -4. -4. 0. 2. 0. 0. -2. 2.]#d
[ 0. -4. 4. 0. -2. 0. 0. 2. -2.]#e
[-4. 0. 0. -4. 2. 0. 0. 2. -2.]#f
[-4. -4. 4. 4. -2. 4. -4. -2. -2.]#g
[ 0. 0. 0. 0. 2. 4. -4. -2. -2.]#h
[ 0. 4. -4. 0. -2. 0. 0. 2. -2.]#i
[-4. 0. 0. -4. 2. 0. 0. 2. -2.]#f
[-4. 4. -4. 4. -2. -4. 4. -2. -2.]#j
[ 0. 0. 0. 0. 2. -4. 4. -2. -2.]#k
[ 0. 0. 0. 0. -2. -4. -4. 2. 2.]#l
[-4. 4. 4. -4. 2. -4. -4. 2. 2.]#m
[-4. 0. 0. 4. -2. 0. 0. -2. 2.]#n
[ 0. 4. 4. 0. 2. 0. 0. -2. 2.]#o
[ 4. 0. 0. -4. -2. 0. 0. -2. 2.]#c
[ 0. -4. -4. 0. 2. 0. 0. -2. 2.]#d
[ 0. 0. 0. 0. -2. -4. -4. 2. 2.]#p
[ 4. -4. -4. 4. 2. -4. -4. 2. 2.]#q
[ 4. -4. 4. -4. -2. -4. 4. -2. -2.]#r
[ 0. 0. 0. 0. 2. -4. 4. -2. -2.]#k
[ 0. -4. 4. 0. -2. 0. 0. 2. -2.]#e
[ 4. 0. 0. 4. 2. 0. 0. 2. -2.]#s
[ 4. 4. -4. -4. -2. 4. -4. -2. -2.]#t
[ 0. 0. 0. 0. 2. 4. -4. -2. -2.]#h
[ 0. 4. -4. 0. -2. 0. 0. 2. -2.]#i
[ 4. 0. 0. 4. 2. 0. 0. 2. -2.]#s
[ 4. 0. 0. -4. -2. 0. 0. -2. 2.]#u
[ 0. 4. 4. 0. 2. 0. 0. -2. 2.]#o
[ 0. 0. 0. 0. -2. 4. 4. 2. 2.]]#a
I don't know why vstack
is adding a period instead of a comma (in the loops each vector S has a comma when I print it separately!).
I need the end result to be an array of unique vectors, (so in this case it'll be vectors a-u ie, 21 vectors).