Linked Questions

10
votes
4answers
422 views

Efficient way of identifying the indices of first occurrences

It seems to me like identifying the first occurrence of unique elements should take about the same amount of time as it takes to delete duplicates. My data sets are much larger than this (...
10
votes
4answers
6k views

Delete duplicate elements from a list

If a list contains duplicate elements, for example list = {a, 1, 5, 3, 5, x^2, x^2}, how can the duplicate elements be removed? The result would be ...
9
votes
4answers
2k views

Checking for duplicates in sublists

I have a list with contains entries that are length 8 sublists,i.e. L1={{a1,b1,c1,d1,A1,B1,C1,D1},{a2,b2,c2,d2,A2,B2,C2,D2},...} and so on. Now, in my problem two ...
7
votes
4answers
187 views

Summing elements in a list by groups indicated by a list of indices

I have two lists, one containing values, the other indices. Now I want to accumulate the values that have the same corresponding index. So for example: ...
6
votes
4answers
378 views

Find the identical rows in a matrix [duplicate]

Suppose I have the following matrix: ...
1
vote
4answers
267 views

Using Select in Subsets [duplicate]

I have a list: list = {{7, 6, 14, 14, 4}, {4, 9, 8, 11, 14}, {20, 12, 12, 11, 3}, {7, 4, 11, 7, 20}, {2, 13, 17, 11, 19}} I did a test to identify where ...
47
votes
3answers
1k views

Why is the new PositionIndex horribly slow?

This issue has largely been mitigated in 10.0.1. New timings for the final test below are: ...
16
votes
3answers
489 views

Retaining and reusing a one-to-one mapping from a sort

Imagine I sort the elements of an array $Q$ by some means. Perhaps I sort strictly by the elements in the first column, perhaps I use SortBy[...] to sequentially sort by the elements in successive ...
4
votes
3answers
338 views

Modify BinLists to give elements indices in list instead of giving the list elements belonging to each bin

How could I use BinLists to give elements indices in list instead of giving the list elements belonging to each bin ? Thanks.
3
votes
3answers
146 views

How to get a description of the positions of similar elements in a list

I want to find a function F to represent the positions of identical elements in a list, which means, for example: ...
8
votes
2answers
302 views

Interpolating four-dimensional data

In this case it is not easy to work with a MWE, so I shall use the actual data which contain initial conditions $(x,y,p_x,p_y)$. Let's see how the data look on the $(x,y)$ plane ...
5
votes
2answers
146 views

Determining lists with equal elements in the same position

I would like to define a function with the following properties: Given a list of equal length sub-lists ls={{a,a,a},{a,b,a},{a,b,c}}; Define a function ...
4
votes
2answers
205 views

position of intersection of two lists

I have the two lists: ...
2
votes
2answers
1k views

Find equal elements on a list

Consider the following code to produce the sequence $x_1,\ldots,x_{n+1}$ where $x_i=11\cdots1$ ($i$ digits 1). Is there an easier way to do this? ...
17
votes
1answer
363 views

Ordering function with recognition of duplicates

Fairly often I have a need to get the Ordering of an expression but with recognition of duplicates. For example: ...

15 30 50 per page