Linked Questions

0
votes
1answer
600 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}
553
votes
19answers
139k 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 ...
66
votes
8answers
9k 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 ...
19
votes
8answers
2k 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
890 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 ...
25
votes
6answers
936 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 ...
11
votes
5answers
471 views

How to remove duplicate elements [duplicate]

How to remove duplicate elements? I want to delete all the same elements in a list. For example, list {1,2,1,2,3,4,5,1}, I want to get ...
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
509 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
127 views

Listing what has been deleted by DeleteDuplicatesBy

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