Linked Questions

0
votes
1answer
545 views

Select duplicate values from a list [duplicate]

How can I select the duplicate values in a list? Example: {1, 2, 1, 1, 1, 1}
525
votes
19answers
130k 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 ...
60
votes
8answers
7k 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 ...
18
votes
8answers
1k views

How do I delete all items that occur more than once?

DeleteDuplicates works fine but leaves a single copy of the duplicated item. I need to remove all items that occur more than once i.e. {{1,2},{1,2},{3,4}} -> ...
13
votes
11answers
809 views

How to pick increasing numbers from the list

How to pick increasing numbers from the list. lst = {5, 3, 6, 2, 7, 4, 8}; out: {5,6,7,8} So many interesting ...
23
votes
6answers
802 views

Returning multiple results from a LibraryLink function

What is the best way to return multiple inhomogeneous results from a LibraryLink function? Imagine that the result of a single computation is several tensors of different dimensions and several ...
12
votes
4answers
1k views

How to rebuild original data from a histogram?

I have data in the following form. I have a list of values and a list of frequencies that indicate how often each value has occurred. Example list of values: ...
15
votes
2answers
2k views

Constructing functions with variable number of output arguments

In Mathematica, you can construct a function f to have different definitions based on its input arguments. For example, ...
2
votes
2answers
486 views

Delete pairs from a list

I have a data set in which I need to remove all matched pairs of entries - not just the first entry that is duplicated but both entries. To add to the complexity, the pairs must be between different ...
2
votes
2answers
106 views

Listing what has been deleted by DeleteDuplicatesBy

How can I list the items deleted from DeleteDuplicatesBy? For example: ...