Skip to main content

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
1 vote
3 answers
159 views

How can I get a list of tuples which sum to zero for three lists of labelled vectors

...
gunes's user avatar
  • 381
1 vote
2 answers
104 views

How to transform a list in the following way?

Consider the following list: ...
John Taylor's user avatar
  • 5,927
1 vote
1 answer
42 views

Applying the MeanFilter function to individual array columns

How can I use the MeanFilter function on only the second or third column of my table? ...
Vladimir's user avatar
  • 359
0 votes
1 answer
54 views

Specific array filtering - code optimization

I have a nested list where all sublists have a length 2, eg: {{1,2}, {1,1}, {3,4}, {3,5}, ...} I need to filter it for two requirements: Delete all sub-lists ...
lesobrod's user avatar
  • 1,904
5 votes
4 answers
241 views

Select elements from a list based on alphabetical order criteria

I have this code to generate the anagrams for a 6 letters word: ...
Rodrigo's user avatar
  • 1,544
0 votes
1 answer
89 views

Error on RecurrenceTable with two variables [closed]

I am trying to simulate a second order filter unit step response with the RecurrenceTable instruction in Mathematica. There's a problem with the second-order ...
Pascal77's user avatar
0 votes
0 answers
59 views

How to make the following pairing?

Consider the following list of identifiers: Npart=5000; ilist=Range[1,Npart]; And parameters belonging to the given identifier: ...
John Taylor's user avatar
  • 5,927
1 vote
1 answer
84 views

How to compute a weighted mean as a measure of central tendency?

Imagine I have data points in triplicates, as follows $$ L=\begin{pmatrix} p_{11} & p_{12} & p_{13}\\ p_{21} & p_{22} & p_{23}\\ & \vdots &\\ p_{n1} & p_{n2} & p_{n3} \...
sam wolfe's user avatar
  • 4,933
0 votes
1 answer
60 views

Pattern matching with DeleteCases

I'm using Mathematica 14.0 and I'm having a pattern match problem with DeleteCases. The example below illustrates the problem. I define a test string followed by two patterns that both nominally match ...
jparm's user avatar
  • 1
4 votes
6 answers
387 views

How do I reshape a list of this form?

I apologize if this is an already answered question, but I haven't been able to find it. I have a long list that has this form: ...
juv95's user avatar
  • 361
5 votes
3 answers
229 views

Extraction of sublists containing certain sequence pairs

list = {{a, b, c, d, a}, {e, f, a, b, c, d}, {a, b, p, q, c, d, g, h}, {c, d, p, q, a, b}, {a, c, b, d}}; I want to filter sublists of ...
eldo's user avatar
  • 82.6k
1 vote
1 answer
72 views

How to obtain positions of graphs satisfying certain conditions?

I first generate some random graphs, and then the following code can filter graphs with maximum degree 8. ...
licheng's user avatar
  • 2,059
2 votes
3 answers
103 views

I'm tired trying to get subsets

t={{a,b},{},{},{},{a},{a,b},{},{a,b,c},{},{b}} s={{},{a,b,c},{a,b}} Thread[Subset[t,s]] I'm tired of trying to calculate: {a,b} [which is the intersection [{a,b}, {...
Alyasaa Jasim's user avatar
2 votes
1 answer
83 views

Delete Null factors out of vector components

After running a very long loop, I get the following result given by a very long vector: ...
Daniel Vainshtein's user avatar
2 votes
3 answers
136 views

Issue in the calculus of inverse of terms from a list

to begin i want to warn you that i am a beginner in mathematica. I have to create a function that calculates the impedance total of an association of n (electronical) components. So the formula is 1/Z(...
ShoupinouZz's user avatar
4 votes
4 answers
135 views

Extracting special sublists from a list

modified list From a numerical evaluation I get examplary result ...
Ulrich Neumann's user avatar
0 votes
0 answers
104 views

Checking whether a set system is intersecting

I have a set of set systems g. I want to select from g those sets systems that are intersecting, that is for every two sets in ...
Sean Longbrake's user avatar
3 votes
1 answer
105 views

How to get the function-basis as they appear in the expression?

I have the following expression containing functions eg. Log, PolyLog etc, ...
BabaYaga's user avatar
  • 1,897
0 votes
1 answer
100 views

Binary algorithm for finding the range of elements

Consider a sorted list of real numbers listz and some boolean condition condition that involves these numbers: ...
John Taylor's user avatar
  • 5,927
0 votes
0 answers
25 views

Performing Efficient Select on Data with Different Time Resolution

I have two data sources with different time resolution. For data source A (temperature) I have about 1 s time resolution. For data source B (spectra) I have 0.01 s time resolution. I would like to ...
BesselFunct's user avatar
4 votes
3 answers
667 views

How to remove a high accuracy numerical number from a list?

My numerical calculation gives a list of numbers list = {-0.36, 0.2499999999999992, -0.21, 0.36, 0.36}, I want to delete 0.25 ...
MMA13's user avatar
  • 4,739
3 votes
2 answers
180 views

Select a subset in the bit-strings with even 1s overlapped - thank you

Model 1 Consider the permutation list of 4-bit-strings: list = Permutations[{0, 0, 1, 1}, {4}] which outputs: {{0, 0, 1, 1}, {0, 1, 0, 1}, {0, 1, 1, 0}, {1, 0, 0, ...
wonderich's user avatar
  • 923
2 votes
1 answer
55 views

Is it possible to ask Mathematica to give/find this largest (absolute value) argument of $\cosh$ in the expression?

I have the expression exp in terms of Cosh functions: ...
MsMath's user avatar
  • 195
5 votes
2 answers
153 views

DateSelect : columnwise selection applied to a matrix

Let consider : A time interval (January given by Time) A random set of values (Minimal example values given by Val) as ...
Jocelyn Minini's user avatar
3 votes
1 answer
61 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
58 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,430
8 votes
10 answers
508 views

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

I have a list containing sublists. ...
Laurenso's user avatar
  • 1,118
6 votes
1 answer
243 views

How to make scrollable TogglerBar?

Consider the following TogglerBar: ...
John Taylor's user avatar
  • 5,927
7 votes
8 answers
189 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
  • 5,015
5 votes
2 answers
293 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.1k
4 votes
6 answers
509 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
  • 5,927
4 votes
4 answers
340 views

How to extract the following data?

Consider the following table: ...
John Taylor's user avatar
  • 5,927
1 vote
2 answers
101 views

How to extract the following data from the file?

Consider the following file. It has the form ...
John Taylor's user avatar
  • 5,927
13 votes
14 answers
889 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,788
4 votes
8 answers
480 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
  • 1,118
1 vote
2 answers
72 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,111
2 votes
2 answers
91 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,430
6 votes
7 answers
612 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
10 votes
5 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 ...
am567's user avatar
  • 673
1 vote
1 answer
68 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
705 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 ...
am567's user avatar
  • 673
2 votes
3 answers
367 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
665 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
  • 2,203
2 votes
1 answer
54 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
  • 5,927
5 votes
3 answers
303 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
  • 5,927
1 vote
0 answers
58 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,438
1 vote
2 answers
75 views

How to leave only the columns satisfying the following condition?

Consider the following pre-generated table: ...
John Taylor's user avatar
  • 5,927
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,904
0 votes
0 answers
45 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
11 votes
7 answers
773 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,672

1
2 3 4 5
17