# Tagged Questions

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.

78 views

### binning list of lists in unequal bin lengths

I'm lookin for binning of ...
95 views

### Group matrix values by column [closed]

Original Question: I have a list {{a, 1}, {b, 3}, {c, 1}, {d, 2}, {e, 3}}. I want to be able to group the the first number in each pair that has the same second ...
83 views

### Group Datasets and take minimum/maximum

Good Morning I have the following dataset: And I try to reach this output: key: only one row per key text: join all texts of the rows with the same key (but no duplicates) min: take the lowest ...
64 views

### Creating Association [duplicate]

I have provided a dataset bellow and I would like to store the data as an Association that I can query. Such that e.g. ...
86 views

### Problem with Custom Sort/Split/Gather

Please help me Sort/Split/Gather/Group(by) a set of symbolic expressions! (extreme TL;DR at bottom) I have a set of symbols (which represent 2-vectors in a plane, ultimately) and I want to sort/...
446 views

### Reshaping associations, generalization of GroupBy

Let's say we have a set a\of associations: ...
91 views

### Role of Accuracy in numerical evaluations, SplitBy vs GatherBy

This is a follow-up question to this question. I generated a list by substituting the results of a solve[] routine and set: ...
325 views

### Partition a list based on specific elements? Grab the sublists beginning with a certain marker elements

Say I have the list {{a}, {0, 2, 5}, {5, 4, 1}, {a}, {1, 1, 0}, {1, 4, 2}, {3, 3, 0}, {a}, {3, 2, 0}, {1, 4, 1}} I would like to make sublists of everything ...
141 views

### Grouping by total length of elements grouped

How might one split a list of irregularly-long sublists into groups, each of which is shorter than a specified length? For example, given the following input: ...
464 views

### How to organically build up nested associations?

Suppose I want to construct an association of associations, such as a list of people with attributes: ...
607 views

### GroupBy twice gives different results

Bug introduced in 7.0 or earlier and persisting through 10.4 or later It took me quite a lot of time to finally trace down to this strange output. I really don't know why. First, I create a list ...
132 views

### Grouping words by their differences

I'm a new guy here and I face a problem. I should pair the following words according to the rule: pair the words, that differ by max. 2 characters, like: ...
375 views

### Exception with GatherBy: gathering complex conjugates

I want to gather the complex-conjugates that are in a list, but with an exception: only if the imaginary part isn't zero. For example: ...
153 views

### Allocate amount A according to the distribution of amount B

I have a cost that varies by category and date. I also have the counts of each item type within each category and date. I want to distribute the cost to each of the item types. I'm trying to use <...
164 views

### Grouping the list of numbers that have common.

I am working on some simple problem. It is like puzzle.. Let's say I have some list input={{1,1},{1,2},{1,3},{2,3},{3,3},{4,4}} Which means 1 can go and back to ...
155 views

### Join nested lists based on first and last elements within each list

I have a nested list like this: test1 = {{1, 3}, {1, 4}, {1, 7}, {2, 1}, {3, 5}, {4, 1}, {5, 2}, {6, 1}, {7, 6}} I want to join the lists together depending on ...
101 views

### GatherBy output with given Shape

I would like to group items in a binary list according to some property like in the following simple example. ...
294 views

### Handy / flexible directory tree operations

Is there any shorter / more handy / more flexible way to get directory tree as a nested Rules/Associations list? I tried to incorporate ...
94 views

Using the code, where ds is data formatted into a Dataset GroupBy[ds, First] // TableForm I get a table that I wanted, but I was wondering if I could somehow use ...
166 views

### GatherBy based on condition imposed on index variable

Excuse me. This might be user specific question but I need your help. I have an indexed data, where positive integers are used for indexing data. I am trying to group data putting condition on index ...
136 views

### How to sum values in the list that belongs to same week

I need to sum values that belongs to same week. For example, I have the list x with one column and n rows. Format: ...
529 views

### Partitioning time series

I have a time series dataset I'm trying to plot by Year: ...
342 views

### GroupBy a list of associations with their keys

How can I go from ...
475 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 ...
90 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 "...
307 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 ...
539 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 ...
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: ...