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.

717 questions
Filter by
Sorted by
Tagged with
234 views

Association vs Pair - Creation performance, Selection performance

Suppose that we ...
• 2,451
77 views

Classifying elements, by the value of a fixed function, using Replace

Let L be a list of several lists. And the length of each list is less than 1000. You can create L by ...
• 2,451
1 vote
71 views

sometimes Select / sometimes Position is faster

As you see, For list L, L1(Select method) is slower than L2(Position method). But for list <...
• 2,451
1 vote
172 views

How to pick lists to satisfy a given form?

I have a list of the following struture: (my real list also has the same structure, just much longer not just 12) ...
• 1,656
1 vote
22 views

TreePosition with multiple (not just node data) conditions

Given a Tree object, TreePosition takes patterns only on the "data" of the node plus a level spec. ...
• 3,720
65 views

get positions satisfying multiple criteria

Given a list L. It is mathematically proven that there is no element in L matching 2 or more patterns in ...
• 2,451
88 views

How to remove duplicates from a pair with some conditions?

Here is a simpler example of my real problem. Assume that I have a groups which includes sublists as follows: ...
• 2,147
69 views

Select with simplification does not work

Given a list, I want to find all elements that have positive imaginary part. For example, if $y,z\in\mathbb R$ and $a>0$ and the list is $\{ ia+y, -ia+z\}$, then the result should be $\{ia+y\}$. ...
• 909
47 views

How to DeleteDuplicates from a list of Rules having set to different values whereby we wish to drop the last occurrence?

About This Function This will eventually set default values for Options based on the end users preferences so that no OptionsPattern need ever be set. The symbol<...
• 1,647
1 vote
49 views

Sorted Tuples without Filtering

Say I have a list $L$ where the elements can be sorted into some canonical order. I want to use Tuples[L,m] but I only want the output lists to be sorted and ...
26 views

Exclude blank values from dataset (GeoPosition)

Any idea how to filter this dataset to exclude blank values in FlightPath?
1 vote
76 views

How to filter out the elements that meet the requirements [closed]

How to filter out the elements {a,b,c} to form a list that meet the requirements 0 <= a <= 1 && 0 <= b <= 1 && 0 <= c <= 1? I used Cases, but the result is not a list....
• 1,365
56 views

Substitude similar symbols

In the examplary list ...
• 36.3k
88 views

Compute the sum of digits of very large integers via table and filtering

I am trying to find the smallest multiple of 2022 whose digits add up to 2022. So I built a table of such numbers, then trying to see which cases pass. This number will obviously have at the very ...
• 389
1 vote
34 views

Select with a variable in the condition always returns the empty set

Mathematica beginner here. I have a function that picks indices based on the value of a passed variable x. This works fine when a concrete value is picked for the variable: ...
267 views

List letters at even- or odd-numbered positions in Alphabet

To make a list of the letters at even-numbered position in Alphabet, I wrote this code: Select[Alphabet[], EvenQ[Flatten[Position[Alphabet[], #]]] &] But it ...
• 173
128 views

Change a group of values in a list of association

Noob here. I want to change the value of all the keys "e", that meet my filter criteria ("c" and "d" are above or equal 20). ...
91 views

...
• 463
104 views

Selecting patterns

I have data as a list of four element lists, some with missing data, thus ...
• 579
34 views

Chebyshev I LPF filter phase shift

I'm trying to design a Chebyshev filter with zero phase shift but I'm doing something wrong here and it would be great if anyone can point me the right way. My Functions are: ...
• 317
64 views

Select data based on string pattern

I'm trying to select data from nested lists based on seconds. This is my data: ...
• 327
167 views

Select behaving differently with Dataset and List

I have just encountered what I would term an unexpected disagreement in behaviour between Dataset and List. Consider the ...
• 4,677
1 vote
75 views

Using multiple criteria with Select [closed]

Suppose I have this list of strings... test = {"abc", "abcdef", "ghi", "jkl"} ...and wish to filter it, selecting only ...
• 3,446
54 views

Cases with condition and two different outcomes

Given t1 = {{{{3}, {2, 5}}, 1}, {{{3}, {2, 7}}, 5}, {{{2, 7}, {3, 7}}, 7}, {{{2, 7}, {3, 5}}, 1}} I want to double the first part if only one number is present ...
• 2,020
47 views

Delete/Drop nested columns within dataset

I have sorted some data into a dataset, but when exporting the dataset to be an external file I would only need certain columns within the dataset. I would like to drop the everything within the "...
• 73
1 vote
51 views

selecting specific part of data set [closed]

I have data set in form {section, Arcangale ,X,Y, type}. Section is the number between 1 to 3 (1,2,3), Arcangale is number change from 0 to 1 something like this (0.0176575), x and y are coordinate (...
• 383
55 views

Check if a fraction leads to an integer, choose $r$ and run trough $0\le a\le n$ and go to $r+1$

Well, I am trying to do the following: I have two functions $y(r,a)$ and $z(r,a)$ and I want to check of the division of both those functions leads to an integer. In order to do that I want to choose ...
• 1,723
134 views

How can I remove First[{}] from the output list of a function?

Consider: listOfKeys = {"Ambientalismo", "Anoressia"}; list2 = First /@ (WikidataSearch /@ listOfKeys) I've tried ...
• 518
1 vote
49 views

Selecting the Nearest First

Imagine I have the following list ...
• 4,138
1 vote
58 views

Select n elements of the list [closed]

I have a list of elements data = {-0.023504, -0.022846, -0.022846, -0.025479, -0.025479, -0.024821,...} The list consists of 20000 elements. How to select first ...
145 views

Mathematica edit list elements

I wanted to delete pair with the same argument and leave the pair with the lowest value, for example we have list: ...
151 views

How can I speed up processing with DeleteCases?

I would like to get points that are only inside a region. Here are the region and unfiltered points: ...
• 2,977
138 views

Pick with Unitize vs Pick with Clip vs Compiled Select speed - anything faster?

Given a large list of $n$ dimensional sublists where each sublist has integer elements I am trying to find the quickest way of finding all sublists that satisfy some constraint on their elements. A ...
• 485
80 views

How to create a dataset out of the entities?

I am working on learning how to create a dataset from a series of entities. I have the following function that finds all properties of a certain entity: ...
• 1,037
32 views

How to keep track of multiple properties of entities?

I have the following lines of code: ...
• 1,037
122 views

How to select data using conditions from associations?

Consider the following dataset: ...
• 3,542
123 views

How to access a Dataset column via a variable

I want to pick values of varying columns from a dataset, eg. from the Dataset in the documentation ...
• 5,453
1 vote
73 views

How to test for arguments for a pattern that is of a positive Integer OR Infinity so that both filter through to the definition on RHS?

How can I filter an argument of a function so that definition works on positive Integers (y >= 0) or Infinity? It will ...
• 1,647
42 views

Multicriterial filtering operators in Datasets

How to generate a long Select query with Dataset-based syntactic sugar? For instance, let we generate the dataset ...
• 1,730
43 views

List with unknown dimension

I have a long list of lists, called Evlist in the following example, which I have to extract information from to be put into new lists Ev and w. I do this with the following code: ...
• 189
44 views

Solving a system of equations (works with squares not with fifth powers)

Well, I was trying to solve a system of equations in a different question of mine. There @kglr gave a very efficient code for solving that system of equations using squares: ...
• 1,723
83 views

Removing a element from list when obeying a certain condition

Well, I have the following code: Select[PowersRepresentations[n, a, b], DuplicateFreeQ[#] && ! MemberQ[#, 0] &] This code finds ...
• 1,723
58 views

select subset of combinations based on condition

My question is about choosing a subset of combinations within a list, based on a condition. Fot example, a shop sells 26 products. The name of a product starts with a letter. Each product has a price. ...
• 2,371
1 vote
45 views

remove erroneous values from array

I have a set of squares arrays (images) of values -100k to 100k. Occasionally the camera that generates the images has a readout error and reads an extremely high value (in the 10e30 range). These are ...
• 147
66 views

how to run multiple notebook at the same time using multiple kernels

My problem is that the second notebook file opens but waits for the first notebook to be evaluated. I want to execute both file1.nb and file2.nb at the same time. Here is my code. any idea? ...
203 views

Why does GaussianFilter not have a periodic option?

Let us say I have a table: tab = RandomReal[{-1, 1}, {128, 128}]; I can filter it using GaussianFilter as follows ...
• 21.7k
1 vote
63 views

Replacing data in a new table using the index

This problem might be similar to others but I could not find the solution with the extra step I need. I have two tables with the same value on the x axis, and different in the y. I want to pick values ...
• 81
113 views

How to separate these circle based on their pixels mean intensity?

I have this image I want to separate green circles from yellow circle in two different images whiteout changing the pixel intensity information. I used the mean intensity ...
• 23
1 vote
39 views

Using MinimalBy to find list with smallest sum of absolute values

I have a list of lists: ...
• 3,446