I once copied a line of code from stackoverflow:
clusters = [x for n, x in enumerate(vecarray) if x not in vecarray[:n]]
I understand what it does, but not how. It gives me all the unique rows of the array 'vecarray' and saves them in 'clusters'. I do have basic understanding of normal for loops, but this structure looks different.
How would I edit this line of code, if I also want to save the indices the found rows (basically in what row did the loop find the next unique number)
Can someone shed light on it?
clustersand what you would like to see changed.