Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
1answer
26 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
78 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
45 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
200 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
188 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
29 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
105 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
36 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
69 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
68 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
174 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
198 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
67 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
29 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
46 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
56 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
65 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
151 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
109 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
37 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
49 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
124 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
97 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
35 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
82 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
171 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
131 views

Selecting elements satisfying a condition

I have a list of lists(of lists): ...
5
votes
1answer
139 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
123 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
159 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
132 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
136 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
169 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
109 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
123 views

Cases, Pattern, Condition [duplicate]

I supposed Cases would do the list produced as example li = RandomSample[Range[100, 999], 30] ...
19
votes
4answers
908 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 ...
0
votes
2answers
44 views

Replace single element of a nested list with multiple elements

I wonder how to replace specific element (even though repeated) within sublists of a nested list with multiple elements while maintaining the list structure. Suppose the following: ...
1
vote
1answer
49 views

Selecting elements using two lists

I made the following list: ...
1
vote
3answers
81 views

Cross checking lists and dropping points that do not belong

I have a list of data that I would like to cross examine with a "correct" list of values and pick out the correct values. For example: ...
4
votes
2answers
115 views

How to use Select for a specific nested list level

I would like to parse every sublist of a nested list and select only those elements that have a certain length, i.e., smaller than 10 elements while maintaining the list structure. Is there any quick ...
5
votes
2answers
173 views

Using DeleteCases to match a string pattern

I am trying to remove all of the elements from a list that contain the characters "err" in that order. I expect the following code to return an empty list: ...
8
votes
2answers
460 views

Ways to speed up Pick

I have a few large arrays (100 times larger than in the example) and I need to re-arrange them. Basically using tests on b and c...
7
votes
2answers
340 views

Deleting duplicates only if they are a certain kind of duplicate

I have a list of tuples like this: {{1,a,b},{1,1,b},{1,a,a},{b,a,1},{b,a,b}} I would like to find a way to delete all those tuples in the list that contain a ...
4
votes
3answers
92 views

Deleting sub-list that contains duplicates

I have a large list of uniform-length lists. What is an efficient way to delete component lists that contain duplicates? For three-item sub-lists, I have used the following code: ...
2
votes
1answer
104 views

DeleteCases does not work with EvenQ? While `Select` works fine [closed]

EvenQ[FromDigits /@ Tuples[{2, 3, 5, 7}, 5]] Works fine. But ...