Linked Questions

5 votes
4 answers
834 views

Removing certain numbers from a list

If I have a list of numbers {1, 2, 4, 70, 11, 20, 56, 79}, is there a way to remove the list {2, 4, 56} from that list? In my ...
8 votes
5 answers
830 views

Complement[] changes order of elements?

Consider this example: Complement[{a, y, c, d, e}, {a, c}, {d}] (*{e, y}*) However, I was expecting the result to be: ...
13 votes
8 answers
1k views

Counting the population of integers

Suppose that myData is a list of sublists. Each sublist has a length of one or greater and contains any number of replicates of the integers 1, 2, 3, and 4. I ...
24 votes
10 answers
2k views

How do I obtain an intersection of two or more list of lists conditioned on the first element of each sub-list?

Given two lists like list1 = {{1, 1}, {2, 4}, {3, 9}, {4, 16}}; list2 = {{2, 6}, {3, 9}, {4, 12}, {5, 15}}; I would like to produce an output like ...
39 votes
11 answers
6k views

Removing elements from a list which appear in another list

There are two lists {a, b, c, a, d, a, e} and {a, c, a}. I need to remove those elements from the first list which appears in a second list, to get {b, d, a, e}
12 votes
7 answers
657 views

How to use Intersection[] but keep the original list order?

I want to keep the original order of l1: ...
22 votes
10 answers
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}} -> ...
2 votes
1 answer
123 views

How to delete a word set in a text?

I have a setence: ...
4 votes
2 answers
123 views

Unexpected behaviour of Condition with Cases/MatchQ?

When using the unsorted version of Complement in this question I met the following unexpected result, ...
3 votes
3 answers
226 views

Dropping list elements that are members of other lists [closed]

I have a set: $$A=\{\{1,2,3\},\{1,3,2\},\{2,1,3\},\{2,3,1\},\{3,1,2\},\{3,2,1\}\}$$ I want to drop elements found in sets B and C from A. $$B=\{\{1,3,2\},\{2,1,3\}\}$$ $$C=\{\{3,1,2\},\{3,2,1\}\}$$ ...
3 votes
1 answer
71 views

Removing elements from nested list [duplicate]

I would like to remove the element of A1 from the list B1: How I can do that? Thank you! A1= {{5, 6}, {4, 5}, {5, 4}} ...
4 votes
1 answer
361 views

Delete all French stopwords [duplicate]

I have a list of french stopwords: ...
2 votes
0 answers
795 views

Subtract Elements of two Lists [duplicate]

I have two Lists: L = {1,2,3,4,5} and K = {1,4}. I would like to delete the elements of K (...
1 vote
1 answer
317 views

What is the fastest way to delete multiple entries from a list? [duplicate]

Mathematica allows Deleting multiple objects from a list given their position. However, if I don't know their positions (finding their positions in the list is too costly if the list is long), how can ...
1 vote
1 answer
68 views

how to substract two tuples selections

i have two tuples select done with modulo on a range {-1,1} : Select[Tuples[Range[-1, 1], 3], Mod[Total[#], 1] == 0 &] and ...

15 30 50 per page