0
$\begingroup$

I have a set of 71 data points. Each data point is represented by its latitude and longitude. I want to divide them into 12 clusters. The first 11 cluster will have exactly 6 points each and 12th cluster will have 5 elements.

Can this be done in Mathematica?

$\endgroup$
3
  • 1
    $\begingroup$ can you give an example of data and expected result? $\endgroup$
    – ZaMoC
    Oct 27, 2018 at 12:02
  • 1
    $\begingroup$ Is this question significantly different from mathematica.stackexchange.com/q/184663/121 ? $\endgroup$
    – Mr.Wizard
    Oct 27, 2018 at 12:25
  • $\begingroup$ Please post your data, so it is hard to understand: "The first 11 cluster will have exactly 11 points each" is 121 points? What about overlapping? $\endgroup$
    – mgamer
    Oct 27, 2018 at 20:50

1 Answer 1

1
$\begingroup$

how about this?

Partition[Range@71, UpTo[11], 6]    

{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, {7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17}, {13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}, {19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29}, {25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35}, {31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41}, {37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}, {43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53}, {49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59}, {55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65}, {61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71}, {67, 68, 69, 70, 71}}

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.