Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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
1answer
45 views

Interpretation of a Code (Cases)

I have the following code, and have been asked to interpret it: Cases[{1, 3.1, 2/3, x, 3 + I, "Yellow"}, _Integer | _Rational | _Real] I tried to play around the ...
7
votes
2answers
149 views

How can I filter an EntityClass by _not_ having a property?

With Mathematica 12, I can create implicit Entity Classes like: I can also filter for having exactly a specific property, like so It seems quite trivial, but I can't seem to filter by a property not ...
3
votes
4answers
201 views

How to select pairs in a list of pairs where the second pair element is within a specified range? [closed]

I have a list like the following list of pairs: ...
0
votes
1answer
25 views

Deleting numbers from a list based on another longer list [closed]

I would like to delete all elements of a list that are equalled to any element found in a bigger list. For example, if I had A = {1,2,3,4,5} and B = {2,4,6,8,9,12} I would like to get C = {1,3,5} ...
0
votes
0answers
23 views

How to select multi vectors with particular condition

I have a matrix as: a01={{225., 1, 2, 3, 4}, {225.5, 2, 3, 4, 5}, {226., 3, 4, 5, 6}, {226.5, 4,5,6,7}} And I want to choose head: ...
0
votes
1answer
31 views

Extract variables from sum of unevaluted functions

I have sums of the form sum = a f[1,1,0] + b f[1,2,0] + c f[1,2,1] + ... It is always linear in f[a,b,c]. I would like a ...
1
vote
0answers
27 views

Use of padding in GaussianFilter

I understand from the help that Padding->None is a valid option for GaussianFilter[] With a setting Padding->None, ...
1
vote
1answer
40 views

Methods to filter [closed]

Hi I have a set of data electrical signal measurement in the time domain, may I seek some suggested on how can I filter this set of data. The measurement was done over a period of 43 sec, at 200Hz ...
0
votes
1answer
35 views

Discarding Files of Different Lengths

I have a set of imported CSV files stored under the variable name data. The imported files are of different lengths and I would like to be able to discard the ones ...
2
votes
2answers
67 views

How to create an array of function values omitting certain values

I'm using Array to create function lists, f[1],f[2],f[3],...,f[A] where the values from $1$ through $A$ have unit increment. ...
3
votes
3answers
59 views

How to delete the matrices which contain specific elements

I have a list which contains some matrices. Some of the matrices contain Overflow[] elements. I want to delete these matrices. ...
1
vote
0answers
43 views

Deleting elements of list without specifying position in list [closed]

I have a list {a,b,c,d,e} and I'd like to delete the letters "c" and "e" to get a list of {a,b,d}. I would like to specify "c" and "e" as my input to a function and not the position of the letters, ...
0
votes
1answer
32 views

Highpass/lowpass a set of {N,2} data, where first column is the time?

How can I highpass/lowpass a set of data, where the sample rate is not fixed, but is the first column of data, ie when data = {{t1,x1},{t2,x2},...{tN,xN}}?
0
votes
1answer
22 views

How to save executing time of select list from multi conditions

I have a matrix: `MT={{1, 54, 55}, {2, 841, 5}, {3, 6, 65}, {4, 28, 328}, {5, 188, 21}, {6, 2, 887}, {7, 36, 32}, {8, 7, 2}}` And i need select the list which ...
8
votes
4answers
275 views

Select elements of a list by comparing it to another list

Suppose I have the following lists: ...
1
vote
1answer
24 views
12
votes
1answer
150 views

Using Select on Dataset with missing keys

I have a very large dataset with about a million entries with up to 75 keys each. Across the whole dataset about half of the keys are blank. In order to reduce filesize, I have used the following ...
2
votes
2answers
87 views

DeleteCases pattern which applies Chop to all elements

In my current macro, I have: DeleteCases[Chop[FullSimplify[RowReduce[something]]], {0 ..}] This works fine for both, exact and numeric complex numbers (with ...
0
votes
2answers
28 views

How to select certain numbers to assign a new value and others still keep same

For an array TestA={15,12,5,8,6}, I want to change the value of number greater than 10 into 0, as TestB={0,0,5,8,6}. When using "Select" command, I will lose some numbers. Thanks.
2
votes
2answers
93 views

How can I implement a simple low pass IIR filter with Mathematica?

I want to design a simple IIR filter with mathematica. For example, consider the filter deigned with this online IIR calculator: ...
8
votes
1answer
138 views

Datasets and Time Values: Filtering and Plotting

After struggling for a few weeks, I have accumulated a few examples of challenging date-related operatations with datasets. Some I have partial solutions; others I cannot yet do. The resources on ...
4
votes
3answers
159 views

Optimising the Selection of MaxValue in Association

Suppose I have the following Association: ...
1
vote
1answer
45 views

Moving map with non-overlapping window

How can I apply a function to a list with non-overlapping window. E.g. $data = \{x_1, x_2, ...., x_n\}$ and we apply f with window size 2 to get $\{f(x_1,x_2), f(x_3, x_4), ...., f(x_{n-1}. x_n)\}$. ...
6
votes
4answers
379 views

How to delete certain lists from a nested list?

I have a nested list as the following example (want to remove lists with same or incremented elements such as {1,2,3,4,5}, {2,2,2,2,2}, {1,1,1,1,1}): ...
8
votes
4answers
332 views

Optimising Table wrapping over a Select

Suppose we have the following lists: ...
1
vote
2answers
107 views

How to use FinancialData[] function to filter stocks based on closing price?

I was wondering if it were possible to use the FinancialData function to return a list of stocks based on a price filter, ie. return all NYSE stocks, that had a ...
3
votes
2answers
56 views

Picking elements from a list

That's must be a very trivial question. Suppose we have the simple list data = {{-1, 0}, {0.2, 0.4}, {4, 0}, {0.3, 0}, {0.2, -0.4}}; Then, is there a quick and ...
1
vote
0answers
35 views

How to filter audio to get best results in correlation?

I am trying to recognise the alphabetical letters by saving some data of records of me and others saying each letter, then comparing a test audio not contained in the data to each letter using the ...
3
votes
3answers
98 views

Find element in a list matching a pattern (using wildcards)

Somehow, I did not manage to find anything related to that. Suppose, in my Global list of variables, I would like to make a search such that I obtain all the ...
1
vote
1answer
27 views

Selecting only the terms whose exponents add up to a specific number

Suppose I have the expression from a truncated series: ...
4
votes
1answer
95 views

Extended Kalman Filter by hand

While trying to learn a bit about control theory, observers and most importantly, to use Microcontroller Kit in version 12 of MMA, I've stumbled upon the KalmanEstimator. After reading a bit (and ...
0
votes
1answer
54 views

Delete elements form a list with elements with strings and numbers

I am trying to create a list list2 removing elements from a list list. The structure of list...
6
votes
2answers
212 views

Find permutation with highest organization number (OEIS A047838)

EDIT: It turns out I misunderstood the definition of "organization number", so the below is incorrect. However, for every permutation I create with my definition of "organization number", I can show ...
6
votes
4answers
204 views

Take elements from a list based on two criteria

I am trying to take elements from a list of tuples using 2 criteria. An example of the list is: list={{-1, -1}, {-1, 1}, {1, 1}, {1, -1}, {1, (1 + I)/Sqrt[2]}} ...
2
votes
1answer
33 views

Select function returns unexpected result [closed]

Recently I notice one fact about the Select function that I do not understand. For example, ...
5
votes
1answer
110 views

DeleteCases using two lists but with partial match?

I searched and tried different solutions on SE but nothing worked. I have two lists and would like to remove items from list1 that have a PARTIAL match with items ...
1
vote
2answers
82 views

Selecting matrices based on existence of unique column and row of all equal terms

So, I have a list of lists of lists such as the following: {{{4}}, {{7, 7}, {7, 7}}, {{5, 5}, {6, 6}}, {{2, 1}, {1, 1}}} Interpreting the elements of this list ...
0
votes
3answers
41 views

Select elements from nested list where one element is largest

I'm trying to speed up the following, but implementing efficient pattern matching isn't intuitive to me yet, even with lots of examples. I have a list of ((x1,y1,z1), (x2,y2,z2)) pairs, and I want to ...
3
votes
2answers
82 views

Using DeleteCases with a defined function with two arguments as a pattern

I am trying to manipulate some large datasets in Mathematica. I have plotted the data, and I would like to be able to easily remove points from the dataset, and it's fairly easy to identify the x-...
0
votes
1answer
76 views

Produce result faster than “Table[If[…]]”

I would like to generate a list of output satisfying some condition for instance an equation but faster than the following code: ...
4
votes
4answers
183 views

Dropping list elements from nested list after evaluation

I need to create a new list from a nested list but using the evaluation as criteria to drop the elements. For example let's say that that I have the following list: ...
3
votes
2answers
222 views

Eliminate empty elements from a list with a specific pattern

I am really new in this patterns part of Mathematica. Basically what I need to do is eliminate null elements from a list but that has a specific name before the empty element. For example, my list is: ...
0
votes
2answers
70 views

Separating variables in a set of equations

I have a very large set of equations eqs with variables denoted by capital letters like PVA[2], QA[2], etc. and small letters like ica[1,2], tr[2,3] etc. And I have ...
0
votes
0answers
30 views

Export XYZ matrix selecting positive Z data points in three files and keeping the matrix form

The following code saves XYZ points in a separated file but keeping the matrix shape. ...
1
vote
2answers
53 views

Select one among multiple solutions that satisfies a certain condition and 3D Plot it with varying simulation values

My function is as follows: $$f(x)=ax^5+bx^4+cx^3+dx^2+ex+g=0$$ Since it does not generate an analytical solution, I tried to do a simulation exercise as follows. Simulation values: $a=-2$, $b=3$, $...
5
votes
1answer
58 views

Select Specific StarData

The help menu for StarData has many examples such as StarData[EntityClass[ "Star", {EntityProperty["Star", "DistanceFromEarth"] -> TakeSmallest[10]}]] ...
3
votes
1answer
33 views

How to check format [closed]

I am having troubles with the following data: slavelist = ResourceData["New Orleans Slave Sales 1856-1861"] I want to select all slaves with: ...
4
votes
2answers
81 views

Selecting elements of a list based on frequency

Suppose I have a list as follow: l = {{"a", "b", "c"}, {"a", "b"}, {"a", "d", "b"}, {"a", "c", "e"}}; Now I am going to flatten it and apply ...
4
votes
2answers
157 views

Commonest[] function doesn't actually show commonest elements

I'm using Commonest function on a list with 500000 words to get the 10 most frequent elements. Then by using WordCloud, I found ...
0
votes
1answer
68 views

Solving x'[t]+a*x[t]==0, listing all the solutions, trying to get the value -1x<1 and all corresponding value of a

I am Trying to solve x'[t]+a*x[t]==0,x[0]==1, for x with {t,0,10} using NDSolve. ...