Questions on gathering, grouping or clustering data based on certain criteria. This is to be used with primary tags such as list-manipulation, string-manipulation or similar tags, with the primary tag indicating the specific use case.

learn more… | top users | synonyms

10
votes
5answers
426 views

How would you efficiently implement BinListsBy?

Let's say I have a list like this: data = {{21, "Alice"}, {27, "Bob"}, {22, "Charles"}, {34, "Dora"}, {75, "Eliza"}} containing ages and names of persons. What I ...
0
votes
1answer
62 views

Sorting a table of vectors with weights [duplicate]

I'm trying to simplify a table, for instance {{1, {4, 2, 0}}, {4, {2, 4, 0}}, {-2, {3, 3, 0}}, {1, {3, 0, 3}}, {-3, {0, 4, 2}}} Here the first column is the ...
3
votes
5answers
181 views

Summarize a list of pairs / (Using GatherBy and Tally?)

Given a list of (frencuently repeated and unsorted) pairs {Mode, SubMode} I want to form the list ...
4
votes
3answers
285 views

Finding connected components in an array

I have an $w\times h$ array with non-negative integers. I wish to partition the set of coordinates $(c,r)$ with $1\leq c \leq w$ and $1\leq r \leq h$, in subsets, so that each subset corresponds to a ...
1
vote
1answer
178 views

Formatting plot of symmetric points differently to asymmetric points

From an array of numbers, I would like to determine (and then colour appropriately) which points are symmetric about a given axis (here, $x = 1/2$), and which are not. For example, form this: ...