Linked Questions

6 votes
2 answers
526 views

Faster Alternative to DeleteDuplicates for deleting elements in list [duplicate]

I have a list in this style data={{a1,b1,c1,d1,e1,f1}, {a2,b2,c2,d2,e2,f2}} I need to delete all elements in which b1 is ...
Antoine Mayer's user avatar
1 vote
2 answers
541 views

Operations on sets of sets [duplicate]

Possible Duplicate: How can I remove B -> A from a list if A -> B is in the list? Delete duplicate elements from list Pattern matching deletion of list items How do I delete the ...
Tyson Williams's user avatar
602 votes
19 answers
156k views

Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
92 votes
5 answers
15k views

What does the construct f[x_] := f[x] = ... mean?

This question mentions "x := x = trickery". What does defining a function as f[x_] := f[x] = ... do and what is it good for?
Chris K's user avatar
  • 20.3k
78 votes
9 answers
12k views

How to efficiently find positions of duplicates?

Is there an efficient way to find the positions of the duplicates in a list? I would like the positions grouped according to duplicated elements. For instance, given ...
Michael E2's user avatar
  • 236k
37 votes
9 answers
4k views

How to select minimal subsets?

I am a newbie, so please point me in the right direction if you feel this question has been answered somewhere else before. Here goes: Suppose I have a list like this: ...
MrDas's user avatar
  • 473
43 votes
6 answers
6k views

How to splice together several instances of InterpolatingFunction?

I have a set of InterpolatingFunction returned by NDSolve which are valid over different (but overall continuous) domains. How ...
polyglot's user avatar
  • 775
22 votes
9 answers
4k views

How do you check if there are any equal arguments(even sublist) in a list?

I would like to set up a function which has to return True if at least two arguments of a given List are equal. So if I give {1,4,6,2} to the function it has to ...
Gianpiero Cea's user avatar
36 votes
3 answers
2k views

DeleteDuplicatesBy is not performing as I'd hoped. Am I missing something?

Déjà vu: a new-in-v10 function should provide a better solution to an old problem, but my enthusiasm is curbed when I run timings. This time the function is ...
Mr.Wizard's user avatar
  • 272k
20 votes
7 answers
2k views

How to use Union on list of lists without sorting them first?

If I do ClearAll[a, d] lsts = {{a, d}, {a, d}}; Union[lsts] I get the expected answer {{a, d}} but if I do ...
Nasser's user avatar
  • 145k
12 votes
4 answers
40k views

Creating a table/Matrix during a For loop

I have a For loop (with i as a counter), which calculates different values (y1, ...
Solarboy's user avatar
  • 121
13 votes
7 answers
1k views

Sort+Union on a list

Probably this is too trivial question for this forum but for some reason I am not getting it on my Mathematica 7 so far. I have a list ...
dbm's user avatar
  • 1,239
2 votes
5 answers
548 views

Combining lists

How can I combine list1={{x1,y1},{x2,y2},{x3,y3}} and list2={{x4,y4},{x5,y5}} to ...
Harald's user avatar
  • 1,583
15 votes
5 answers
258 views

Faster position-based duplicate removal in a ragged array?

Take a ragged 2D array: rArray={{4, 2, 1, 0}, {2, 2}, {0, 0, 3, 3, 3}, {4, 0}, {3, 4}} I need to "deduplicate" this, where a duplicate is any element of a ...
ciao's user avatar
  • 25.8k
6 votes
3 answers
659 views

How to remove duplicate elements from two separated lists efficiently?

I have two lists of elements: indices = {Prime /@ Range[5000], Prime /@ Range[100, 300]} // Flatten; values = RandomReal[100, 3] & /@ Range[Length[indices]]; ...
Purboo's user avatar
  • 677

15 30 50 per page