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

Optimising the Selection of MaxValue in Association

Suppose I have the following Association: ...
1
vote
1answer
38 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
315 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
323 views

Optimising Table wrapping over a Select

Suppose we have the following lists: ...
1
vote
2answers
89 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
55 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
32 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
94 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
87 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
47 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
202 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
194 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
30 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
106 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
81 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
38 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
72 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
69 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
177 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
201 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
68 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
48 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
57 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
71 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
154 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
62 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. ...
0
votes
0answers
50 views

solving inside for loop and sorting x which are less than 3 and greater than -3 from the list

I give a simple function code here... Clear[a, x, t]; s = ParametricNDSolve[{x'[t] + a*x[t] == 0, x[0]==1}, x, {t, 0, 100}, {a}] y = x[1] /. s y[5] /. s I ...
0
votes
2answers
53 views

Filter lists by discarding sublists that contain integers different from 0 or 1

Imagine I have a list of the type Lst = {{1,0,1,1},{4,0,1,1}, {1,1,0,0},{2,1,1,1},{0,0,0,1}} I want to select only those sublists that only contain elements 0 ...
3
votes
2answers
110 views

How to remove from the data the rows of with fixed number of elements? [closed]

Consider the data which has the form data = {{x1,y1,z1},{x2,y2,z2,t2},{x3,y4,z4,t4},{x5,y5,z5},...} How to remove the rows containing three elements from the ...
1
vote
0answers
38 views

How to get a directed graph of size N which is also a connected component?

I need to get graphs of size N, in which the whole graph is a connected component. In particular, I'm working with a Albert-Barabasi distribution, with k=2, and random directed edges. Right now I'm ...
1
vote
1answer
50 views

How to select the data in a given way?

Consider the data data = {{x1,y1,z1},{x2,y2,z2},{x3,y3,z3},{x4,y4,z4},{x5,y5,z5},{x6,y6,z6},...} with N rows. It can be divided into N/6 sets of 6 rows. I want ...
2
votes
3answers
125 views

Signal Processing [closed]

The image above is the list plot of discrete data I'm working on. Please I need help on how to zero out all the high amplitudes signal from the data. That is all the data in areas circled, I want to ...
2
votes
2answers
102 views

Selecting based on criterion on a single column [duplicate]

I have an array that looks like M = {a, b, c, d}, where a, b, c, d are column vectors. I want to select rows from this array ...
1
vote
0answers
36 views

How to visualize and interactively correct time series data [closed]

I am looking for an efficient method to visualize measured time series data with about 100.000 data points per year, such that eye-catching data points may interactively be tagged as suspicious, e.g. ...
3
votes
0answers
83 views

Select certain term containing some patterns and confusing pattern Alternatives in FreeQ

I am considering a function termsContain[func_,list_] which select in an expression func the terms containing the ones in the ...
5
votes
2answers
180 views

Removing anomalous points from data

I have two sets of 2d-data points which can be transformed in each other by using a certain transformation function. The problem is that in both data sets there are points which do not have ...
4
votes
2answers
134 views

Selecting elements satisfying a condition

I have a list of lists(of lists): ...
5
votes
1answer
141 views

Why Cases and Select treat the List differently?

Look at these two examples: In[1]:=Select[f[i], MatchQ[_f]] Out[1]:=f[] In[2]:=Cases[f[i],_f] Out[2]:={} It seems that the Select take $f[i]$ as List, but Cases ...
4
votes
2answers
126 views

Select certain terms in an expression

I would like to have a function to select terms containing q[i] terms in expressions, for example, for an expression a q[i]+b +c q[j]+d I would like the function ...
3
votes
1answer
163 views

Cleaning away data points which are enveloped within a function

I have some data taken in an experiment which I want to fit and analyse. But before I start fitting function, I want to clean points away in a robust but elegant way. I first provide some sample data ...
3
votes
3answers
136 views

using DeleteCases to delete vectors with particular index as 0

Assume I have a set of vectors set = {{0,1,1,0,1}, {1,0,1,1,1}, {1,1,1,1,0},{1,0,0,1,0}}. I want to delete the vectors which have the last entry as 0. In the ...
1
vote
2answers
177 views

Select items from dataset with GUI using checkbox and Togglebar : empty results with DynamicModule

I have a dataset or records, I want to select records with a GUI (manually ticking on the selected item). Then, I want to apply functions to those items (not in this question). I think Im almost ...
3
votes
3answers
178 views

Filter periodical sharp spikes in experimental data

I have experimental data with periodic sharp artefact spikes, which mask the real signal that could be seen as several negative peaks in the first third part on the curve: Is it possible somehow to ...
3
votes
3answers
114 views

How to use “Cases” for isolating terms of a sum in a nice way?

I'd like to isolate some terms with specific patterns within a sum that I called chunk. ...
6
votes
1answer
125 views

Cases, Pattern, Condition [duplicate]

I supposed Cases would do the list produced as example li = RandomSample[Range[100, 999], 30] ...
19
votes
4answers
911 views

How to construct a list of lengths efficiently

Say I have a sorted list of integers RandomInteger[{1, 100000}, 10000] // Sort // Short I want to construct another list whose $m$-th element is the number of ...