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
11 votes
1 answer
234 views

Association vs Pair - Creation performance, Selection performance

Suppose that we ...
user avatar
  • 2,451
3 votes
1 answer
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 ...
user avatar
  • 2,451
1 vote
0 answers
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 <...
user avatar
  • 2,451
1 vote
2 answers
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) ...
user avatar
  • 1,656
1 vote
0 answers
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. ...
user avatar
  • 3,720
0 votes
1 answer
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 ...
user avatar
  • 2,451
3 votes
2 answers
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: ...
user avatar
  • 2,147
3 votes
1 answer
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\}$. ...
user avatar
0 votes
0 answers
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<...
user avatar
  • 1,647
1 vote
1 answer
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 ...
user avatar
0 votes
1 answer
26 views

Exclude blank values from dataset (GeoPosition)

Any idea how to filter this dataset to exclude blank values in FlightPath?
user avatar
1 vote
2 answers
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....
user avatar
  • 1,365
2 votes
2 answers
56 views

Substitude similar symbols

In the examplary list ...
user avatar
0 votes
1 answer
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 ...
user avatar
  • 389
1 vote
2 answers
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: ...
user avatar
4 votes
2 answers
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 ...
user avatar
  • 173
4 votes
3 answers
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). ...
user avatar
2 votes
2 answers
91 views

Is it possible to exclude a condition, say, $f(x,y)=const.$, from a ContourPlot code?

...
user avatar
  • 463
2 votes
3 answers
104 views

Selecting patterns

I have data as a list of four element lists, some with missing data, thus ...
user avatar
  • 579
0 votes
0 answers
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: ...
user avatar
2 votes
1 answer
64 views

Select data based on string pattern

I'm trying to select data from nested lists based on seconds. This is my data: ...
user avatar
  • 327
5 votes
2 answers
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 ...
user avatar
  • 4,677
1 vote
0 answers
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 ...
user avatar
  • 3,446
2 votes
1 answer
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 ...
user avatar
  • 2,020
3 votes
1 answer
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 "...
user avatar
  • 73
1 vote
1 answer
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 (...
user avatar
  • 383
0 votes
1 answer
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 ...
user avatar
  • 1,723
5 votes
1 answer
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 ...
user avatar
  • 518
1 vote
0 answers
49 views

Selecting the Nearest First

Imagine I have the following list ...
user avatar
  • 4,138
1 vote
0 answers
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 ...
user avatar
4 votes
3 answers
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: ...
user avatar
4 votes
1 answer
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: ...
user avatar
7 votes
1 answer
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 ...
user avatar
  • 485
0 votes
1 answer
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: ...
user avatar
0 votes
0 answers
32 views

How to keep track of multiple properties of entities?

I have the following lines of code: ...
user avatar
5 votes
1 answer
122 views

How to select data using conditions from associations?

Consider the following dataset: ...
user avatar
  • 3,542
5 votes
1 answer
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 ...
user avatar
  • 5,453
1 vote
0 answers
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 ...
user avatar
  • 1,647
3 votes
1 answer
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 ...
user avatar
0 votes
0 answers
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: ...
user avatar
0 votes
0 answers
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: ...
user avatar
  • 1,723
3 votes
1 answer
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 ...
user avatar
  • 1,723
3 votes
1 answer
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. ...
user avatar
1 vote
1 answer
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 ...
user avatar
  • 147
0 votes
0 answers
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? ...
user avatar
2 votes
2 answers
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 ...
user avatar
  • 21.7k
1 vote
2 answers
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 ...
user avatar
  • 81
2 votes
1 answer
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 ...
user avatar
  • 23
1 vote
0 answers
39 views

Using MinimalBy to find list with smallest sum of absolute values

I have a list of lists: ...
user avatar
  • 3,446
3 votes
1 answer
102 views

How to extract different curves from a mixed dataset?

Suppose I have a dataset: ...
user avatar
  • 2,633

1
2 3 4 5
15