r/programminghelp • u/gabensucksass • Dec 01 '18
[Python] Running a pairwise test for every element in a list
I am running some stats on every pair in my list of datasets. E.g. array[0] versus array[1], array[0] vs array[2], etc.
Is there a good way to do this other than a nested loop?
Thanks!
4
Upvotes
4
u/[deleted] Dec 01 '18
The nature of the problem requires that for each element in the array, the loop must run the array size times. There won't be any more efficient way of doing that besides a nested loop. Edit: assuming the array isn't ordered in some way or anything