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
0 votes
1 answer
49 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,699
5 votes
4 answers
230 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,534
0 votes
1 answer
88 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
58 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,827
1 vote
1 answer
75 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,863
0 votes
1 answer
49 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
380 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
  • 351
5 votes
3 answers
219 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
  • 74.6k
1 vote
1 answer
71 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,039
2 votes
3 answers
102 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
80 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
134 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
133 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
103 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
103 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,888
0 votes
1 answer
87 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,827
0 votes
0 answers
24 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
662 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,732
3 votes
2 answers
176 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
54 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
150 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
60 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,390
7 votes
7 answers
454 views

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

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

How to make scrollable TogglerBar?

Consider the following TogglerBar: ...
John Taylor's user avatar
  • 5,827
5 votes
6 answers
133 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,833
5 votes
2 answers
287 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.6k
3 votes
5 answers
475 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,827
4 votes
4 answers
336 views

How to extract the following data?

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

How to extract the following data from the file?

Consider the following file. It has the form ...
John Taylor's user avatar
  • 5,827
13 votes
14 answers
875 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,728
4 votes
8 answers
477 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,054
1 vote
2 answers
67 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
89 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,390
6 votes
7 answers
610 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
  • 501
1 vote
1 answer
64 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
700 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
  • 501
2 votes
3 answers
355 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
641 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,155
2 votes
1 answer
52 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,827
5 votes
3 answers
289 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,827
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,418
1 vote
2 answers
74 views

How to leave only the columns satisfying the following condition?

Consider the following pre-generated table: ...
John Taylor's user avatar
  • 5,827
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,699
0 votes
0 answers
44 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
10 votes
6 answers
751 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,652
1 vote
2 answers
84 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
124 views

How to delete a word set in a text?

I have a setence: ...
SAC's user avatar
  • 1,335
5 votes
5 answers
156 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

1
2 3 4 5
17