Questions tagged [filtering]

Questions on filtering or selecting data based on certain criteria. This is to be used with primary tags such as list-manipulation, string-manipulation or signal-processing, with the primary tag indicating the specific use case.

Filter by
Sorted by
Tagged with
3 votes
1 answer
55 views

Can you not use And[] inside a Select[]?

I have a list of lists of integers that are each sorted numerically. Here is a sample of it: {{2, 8, 9}, {3, 7, 9}, {4, 6, 9}, ...}. I wish to only pick out members ...
user2686410's user avatar
0 votes
0 answers
50 views

Comparing graphs in mathematica: shape vs. name

I'm trying to identify and remove duplicate graphs when contracting vertices. To illustrate this, I'll start with two simple graphs where I'm trying to create a function that can recognize them as ...
hana's user avatar
  • 2,678
7 votes
7 answers
406 views

Merging and keeping only the sublists whose first two elements are equal

I have a list containing sublists. ...
Laurenso's user avatar
  • 844
6 votes
1 answer
238 views

How to make scrollable TogglerBar?

Consider the following TogglerBar: ...
John Taylor's user avatar
  • 4,984
5 votes
6 answers
129 views

Extracting up to $n$ elements after a specified marker from a list

I have a list from which I need to select up to two elements that follow each occurrence of a marker. For example, the selected marker is ...
Suite401's user avatar
  • 4,313
5 votes
2 answers
271 views

Express a "not equal to A or B" criterion in Select

I have a list of pairs of strings: myPairsList. I wish to Select all the pairs that do not contain ...
Andrew's user avatar
  • 10.2k
3 votes
5 answers
466 views

How to find the most repeating row?

Consider the following table: tab={{1,0,0,1},{1,0,0,1},{0,1,0,1},{1,0,0,1},{0,0,0,1},{1,0,0,0},{0,1,0,1}} Could you please tell me whether there is a command which ...
John Taylor's user avatar
  • 4,984
4 votes
4 answers
332 views

How to extract the following data?

Consider the following table: ...
John Taylor's user avatar
  • 4,984
1 vote
2 answers
97 views

How to extract the following data from the file?

Consider the following file. It has the form ...
John Taylor's user avatar
  • 4,984
13 votes
13 answers
818 views

Select from list elements greater than next element

Given t1 = {3, 2, 8, 6, 1, 9, 4, 1, 5, 0} I want to get all the elements which are greater than the right neighbor. The result would be ...
user57467's user avatar
  • 2,304
4 votes
8 answers
466 views

How to get a Table of pairs (a/b, c/d) where GCD[a,b]==1 and GCD[c,d]==1?

I am trying to make a Table pairs of (a/b, c/d) where GCD[a,b]==1 and GCD[c,d]==1. I have tried the following: ...
Laurenso's user avatar
  • 844
1 vote
2 answers
60 views

Selecting interesting graph positions with a button press/click or something similar

Assume that I have a graphList as shown below (a simple working example). ...
emnha's user avatar
  • 2,361
2 votes
2 answers
88 views

Looking for solutions to filter out one-sided angle pairs in line intersections

I posted something here a while ago, but I think it's a bit messy and difficult to understand. So, I'll create a new post to explain the concept and what I want in a different way, hopefully making it ...
hana's user avatar
  • 2,678
6 votes
7 answers
593 views

Dropping disordered numbers in a list

I have a list of numbers like l1 = (1,2,3,4,8) and clearly, l1 is in order (next number is greater than previous number). Well, ...
cheese.burger's user avatar
9 votes
4 answers
2k views

Find Roman numerals up to 100 that do not contain “I"

The question is from Elementary Introduction to the Wolfram Language, section 28 Tests and Conditionals: Find Roman numerals up to 100 that do not contain “I”. What am I doing wrong that the following ...
Aislin_367's user avatar
1 vote
1 answer
58 views

Sumif and delete cells in Mathematica

I want to create a simple "sumif" formula like in Excel. However, I am desperate since I cannot achieve a result. First, I am importing an excel file with lot of datas. data = Import[ "...
Thomas858599's user avatar
3 votes
6 answers
676 views

Make a list of the first 100 primes, keeping only ones whose last digit is less than 3 [closed]

This is a question from an "Elementary Introduction to the Wolfram Language" Section 28: Tests and Conditionals. We are asked to "Make a list of the first 100 primes, keeping only ones ...
Aislin_367's user avatar
2 votes
3 answers
315 views

Finding transitive Boolean matrices

I am fairly new here and with Mathematica too. I have a question regarding Boolean matrices but before this I did a random search and got this Defining an arbitrary binary relation But I am unable to ...
Jonathan's user avatar
9 votes
4 answers
602 views

Check if a string is a date

I have a list of strings, {"BD4675365", "Corp", "Managers", "Syndicate", "2021-03-08", "8434926"} and I ...
apg's user avatar
  • 1,937
2 votes
1 answer
49 views

How to select only particular values from the list using dialog windows?

Consider some list: list = {"A","B","C","D"} How to select only particular values from it using a dynamic dialog window ...
John Taylor's user avatar
  • 4,984
5 votes
3 answers
263 views

How can I select only rows where a column is equal to any value from some list? [closed]

Consider some data data=Table[{RandomInteger[{0,10}],RandomReal[{0,1}]},10]; and some list list={0,5,7,3}; How can I leave ...
John Taylor's user avatar
  • 4,984
1 vote
0 answers
49 views

Selecting elements with a particular slope

I have a dataset for which I want to identify 'groupings' based on three criteria, but only one of them is giving me a headache. The criteria are that each group must: have a minimum number of points ...
alex's user avatar
  • 1,396
1 vote
2 answers
64 views

How to leave only the columns satisfying the following condition?

Consider the following pre-generated table: ...
John Taylor's user avatar
  • 4,984
0 votes
0 answers
41 views

Optimization of conditions applying

Let we have some data generator, e.g. lazy tuples or permutations. I need to select data by some conditions cond1, cond2, …, up to 5-6 conditions. All of them need ...
lesobrod's user avatar
  • 1,085
0 votes
0 answers
42 views

Speed up Select Operating on a Large List with Multiple Criteria

I am using the following code to select stocks that have performance data starting before one specified date and ending after a second specified date, as follows: ...
Jonathan Kinlay's user avatar
9 votes
6 answers
722 views

Can I tell DeleteCases not to delete function arguments?

Given list = {1, 2, f[3, 4], {5, {6, g[7, h[8, 9]]}}, {f[10], 11}}; I want to get {f[3, 4], {{g[7, h[8, 9]]}}, {f[10]}} just ...
expression's user avatar
  • 5,562
1 vote
2 answers
57 views

How to make lists all the same length by automatically removing every second element?

I have 20 files of matrices which all contain the same kind of data. I can import and take the single column I need out of every file into a list. I need to average each of the 20 file's lists ...
Claudia's user avatar
  • 31
2 votes
1 answer
121 views

How to delete a word set in a text?

I have a setence: ...
SAC's user avatar
  • 1,335
2 votes
2 answers
108 views

Remove sublists with duplicate elements within

I have this list DeleteDuplicates[Sort[#] & /@ Tuples[Range[4], 3]] which gives me {{1, 1, 1}, {1, 1, 2}, {1, 1, 3}, {1, 1, 4}, {1, 2, 2}, {1, 2, 3}, {1, 2, 4},...
Ruth Lazkoz's user avatar
6 votes
3 answers
292 views

Apply pattern using a Slot (#) to each list element using a second slot

I am trying to find a neat way of applying an operation to each list element, but do not know how to properly use multiple slots or whether it is actually possible to solve this with multiple slots. I ...
michelangelov's user avatar
-1 votes
1 answer
67 views

How to Paste Complex Transfer Function Equation to Excel [closed]

I am trying to paste this transfer function to Excel, is it possible?
analog_designer's user avatar
5 votes
4 answers
177 views

Filtering out function pairs with domains lying on one side (left or right) of an intersection point

I have a list of pairs of functions that intersect at one point, as shown in the image. I am attempting to remove pairs where the domain of both functions in the pair lie on one side of the ...
hana's user avatar
  • 2,678
5 votes
3 answers
272 views

Delete first case

How to delete just first occurrence of given value from a list? Without sorting etc. Something like this: ...
lesobrod's user avatar
  • 1,085
4 votes
2 answers
307 views

Why does Select not work here?

Why does this not work? It returns empty while I expect the first two elements are selected. ...
internet's user avatar
  • 431
0 votes
1 answer
53 views

What's the expression of transformation T in area-based Image operations such as ImageFilter and ImageConvolve?

in the “tutorial/ImageProcessing”, as the following picture shows I just wonder what's the expression of the T in the area-based image operations such as ...
Aerterliusi's user avatar
4 votes
2 answers
117 views

How to discard the repeating elements of a list [closed]

Lets say there is a random list of expressions : a={Sin[x], Sin[3 x], Sin[4 x], Sin[x], Sin[4 x], Sin[x], Sin [5 x], Sin[3 x], Sin[5 x]} Plot[{a}, {x, 0, 2 Pi}] ...
a019's user avatar
  • 811
1 vote
1 answer
50 views

How to convert or filter a comma-numbered elements in a data to number as elements in filtered data?

My subset data (10 Rows, 3 Columns) of the big data looks like this: ...
Kumar Gaurav Sagar's user avatar
5 votes
5 answers
185 views

How to select elements from a list of pairs based on first element belonging to a different list?

This is my very first question and I really appreciate this ability and thankful the community. I have two lists and need to select only those pairs from the first list, first element of which is ...
Igor Binder's user avatar
0 votes
3 answers
72 views

Use the command Select to find all integers x in the list $r=Range[16]$ such that $Mod[x^4,17]=-1$ and also try doing it by cases command

My try: r = Range[16]; Select[r, Mod[x^4,17] = -1] but it doesn't work. How can I do it?
Mahmoud albahar's user avatar
4 votes
1 answer
97 views

What does Dash Question mark do? [closed]

This is an example I'm reading that picks out the Primes, but I don't quite see how the _? works. I haven't seen it before and can't find it in Help. ...
cybervigilante's user avatar
5 votes
1 answer
395 views

I understand b_ matches beta, but why does it also match alpha?

Why does this pick out everything instead of just beta? Cases[{alpha, beta, mxyzptlk}, b_] In a function you have to match the ...
cybervigilante's user avatar
0 votes
0 answers
104 views

Removing "spikes" in data

Imagine I have a data set which gives me the following ListLinePlot Is it possible to define a function over the data set that removes the "spikes" ...
sam wolfe's user avatar
  • 4,187
2 votes
3 answers
116 views

Removing lists containing some rules

Consider a big list of lists of rules, namely ...
Smilia's user avatar
  • 592
1 vote
1 answer
97 views

How to use Fold on Select with a list of conditions to progressively eliminate from a list?

The application of Reduce (over the integers) to an equation produces, after the application of LogicalExpand, a list of 1296 And'ed logical conditions (in 9 generated parameters, 5 of which are ...
Julian Moore's user avatar
  • 2,560
0 votes
1 answer
52 views

Sorting a list with certain conditions [closed]

I have this List1: ...
Mam Mam's user avatar
  • 1,731
0 votes
0 answers
94 views

Motion blurring in the frequency domain

My task is to implement a motion blurring filter via the frequency domain. The transfer function for this is as follows: I previously consulted this answer for starter code. My function is shown below:...
taha's user avatar
  • 1
4 votes
6 answers
438 views

How to leave only rows satisfying a particular condition from a table?

Consider the following table: tab={{1,2},{3,67},{96,1},{1,19},{894,55},{10111,23},{20000,23},{5,93},{5,97},{22,34},{0,1}}; How to select only those rows for which <...
John Taylor's user avatar
  • 4,984
3 votes
1 answer
64 views

Selecting the negative expression

Let Theta,t be real variables and Phi an expression of ...
Smilia's user avatar
  • 592
1 vote
3 answers
100 views

Rewrite the list without certain elements in the sequence

I have a list1: ...
Mam Mam's user avatar
  • 1,731
2 votes
2 answers
102 views

Remove some part of data

Consider the following dataset: ...
John Taylor's user avatar
  • 4,984

1
2 3 4 5
16