153 views

List manipulation - grouping sublists according to their first element

I have the following list: ...
95 views

Conditional union of a nested list

With a nested list such as listA = {{{a,b,c},{1,0,0}}, {{a,b,c},{0,1,0}}, {{d,e,f},{1,1,0}}}; How can I create ...
63 views

How to reshape a list in a predefined way? [duplicate]

Consider a list (list) as ...
305 views

Sum some columns in list of associations grouped by other columns

I often need to sum values in a list of Associations according to some columns in that Association. I have a way of doing it, ...
1k views

List of tuples: group by first element of tuple; sum up the second element per group [duplicate]

Imagine following list list = {{0, 3}, {1, 1}, {1, 2}, {2, 3}, {2, 4}} I would like to get the result ...
152 views

Association Sum by key [duplicate]

I get results from FindInstance as a list of associations. {{a -> 1, b -> 2}, {a -> 3, b -> 4}} I would like to ...
141 views

A package I'm working on uses rule solutions (like the output of Solve) as inputs to functions. I'd like to be able to easily manipulate these rule solutions by ...
169 views

How to modify multiple rules in a single list

How can I modify multiple rules simultaneously in a single list of rules? Right now I generate two lists, where both rules are replaced with the same value in each single list. But what I want is the ...
348 views

Mapping AssociationThread over list with repeating keys [closed]

I have two lists. One with the same repeating four keys and the other with unique values. Both are the same length. I want to Associate the first list with the second list. So if that if the 5th ...
206 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 ...
81 views

Matching list entries by two values, adding the third [duplicate]

I have data in form of: data={{1,1,3},{1,1,6},{2,1,7},{2,2,4},{2,1,1}}; I want to match the entries with the same first two elements and add the third element in ...
404 views

Average dataset with many repetitions?

I have a dataset where each item is of the form: <|"p1" -> x1, "p2" -> x2, "r1" -> y1, "r2" -> y2|> The interpretation is this: ...
195 views

Add up data values for matching entries [duplicate]

Is there a function that extends Tally in the following way (essentially need an answer to this guy's homework question): the a <...