Several ways, but the easiest would be to use numpy.split (https://docs.scipy.org/doc/numpy/reference/generated/numpy.split.html …) to slice X, then iterate over the sliced matrix.
-
-
Replying to @seaandsailor
I tried it that way and failed miserably. I guess I should think again. I think because I spent all day on this I should probably stop...
1 reply 0 retweets 0 likes -
Replying to @o_guest @seaandsailor
I couldn't get my head around it and I guess I've exhausted myself now.
1 reply 0 retweets 0 likes -
Replying to @o_guest
Yes, the slicing way is actually really tricky. I forgot pdist computes pairwise distances between ALL samples.
1 reply 0 retweets 1 like -
-
Replying to @o_guest
Just realized you can probably use itertools.product to get all the combinations, slice the combination matrix, and do as I suggested!
1 reply 0 retweets 1 like -
-
Replying to @o_guest @seaandsailor
If you know of a working example I could base this off I would love a to see and be indebted. I've also thought of some more ideas to try.
1 reply 0 retweets 0 likes -
Replying to @o_guest @seaandsailor
are you sure you mean itertools.product?
1 reply 0 retweets 0 likes -
Replying to @o_guest
you actually can use itertools.combinations as it does what I meant more directly. product would be used on lists of indices, not the matrix
1 reply 0 retweets 0 likes
I am actually completely stuck — sorry. Maybe if you have time we could chat, but otherwise I don't understand at all. 
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.

