Stack Exchange Network

Stack Exchange network consists of 174 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
34 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
109 views

Signal Processing [on hold]

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
76 views

Selecting based on criterion on a single column

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
32 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. ...
-2
votes
0answers
60 views

Selecting and doing calulations on specific columns of data [duplicate]

I have a large csv file (1.5GB) that has 14 columns and a tonne of rows. I need the 2nd,7th and 11th columns. I want to import some of the rows by season, which is in the 11th column in the format dd/...
3
votes
0answers
79 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 ...
-1
votes
0answers
45 views

Trying to select data in a csv based on month

I have a csv file that has the measured data (conc), where it was collected (z) and date. I'm trying to select data based on the month it was collected in so I can plot them separately and compare. I ...
5
votes
2answers
155 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
90 views

Selecting elements satisfying a condition

I have a list of lists(of lists): ...
5
votes
1answer
114 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
97 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
154 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 ...
1
vote
2answers
105 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
120 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
97 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
114 views

Cases, Pattern, Condition [duplicate]

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

Selecting elements using two lists

I made the following list: ...
1
vote
3answers
56 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
100 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
155 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
454 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
330 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
64 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
101 views

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

EvenQ[FromDigits /@ Tuples[{2, 3, 5, 7}, 5]] Works fine. But ...
1
vote
2answers
34 views

Select equations with RHS!=0 from a list

I need to select from a list containing equations those having RHS not zero ...
0
votes
1answer
52 views

How to automatically select solutions from a set of solutions given by Solve?

I have a function of trigonometric functions which must be equated to zero in order to obtain the appropriate results. This is done in the following fashion: ...
0
votes
1answer
55 views

How to replace a special arrow and row in a matrix with a symbol and drop it? [closed]

I need to do a iteration, if condition[i] is true, I want to drop i row and i column in the matrix A. To keep the index of A unchanged, I think I should replace i row and i column as zero or other ...
2
votes
1answer
50 views

Filter rows in nested Association / Dataset using Select

The Dataset I am working with has the following nested structure. ...
2
votes
1answer
55 views

Select elements in a list of tuples of quaternions that satisfy a condition

I defined 24 quaternions using the Quaternions package and i create the list of all possible 4-tuples using ListQuad = Tuples[ListQuaternions, 4] where ...
7
votes
3answers
182 views

Finding items satisfying a condition in a list using patterns

Why the following command Cases[{1, 2, 6, 3, 4, 8, 5}, {x_, y_, z_} /; (y > Max[x, z]):>y] doesn't return the y values that are greater than their ...
12
votes
10answers
1k views

Given a list of integers, find the largest sum of a contiguous subsequence

Given a list of integers, find the largest sum of a contiguous sub-sequence. {1, 2, 3, 4, 5, -1, 7, -4, -2} (* 21 *) And print the sub-array which is ...
1
vote
1answer
34 views

how to filter a table based on predicates involving column values

I would like to select a small subset of rows of a table based on a predicate involving multiple columns. Here's a small example of what I want using For[]: ...
0
votes
0answers
34 views

Scraping Images that are Directly Embedded in a Webpage or Dynamic?

I need to scrape URLs for photo albums like Flickr and Facebook for images from a certain event. I'm trying to use Import["link", "Images"], as shown at https://...
2
votes
1answer
31 views

Why does N result in some inconsistency in this context?

In the following, why does N not produce the expected decimal output, while Round does? ...
13
votes
2answers
362 views

How to build a list of elements satisfying a certain property without building a list of all elements first?

Is there a way to directly build a list of elements that satisfy a certain property? More precisely, I am looking for a function IncludeIf (this is a placeholder ...
1
vote
4answers
79 views

How to extract certain rows satisfying a condition?

I have three columns - P1,P2,M and 411935 rows. I want to extract only those rows which satisfy P1>=P2>=0.25*M. How can I do it?
1
vote
1answer
53 views

How to select terms which contain certain letters?

I would like to select the term Subscript[Cos\[CapitalDelta], Subscript[p, B]] of expression ...
6
votes
3answers
312 views

Remove elements from deep nested list

I have a list like this. How do I traverse the sublists to remove all the 1.'s but leaving the structure intact? I have attempted with Drop[list, {1}] but this ...
0
votes
0answers
50 views

Butterworth single pole, 5 Hz cut-off frequency on accelerometer data for single axis

I have read other posts here on using the Butterworth filter in Mathematica, however, I am having a hard time understanding the chain of functions and their parameters as applied to my case, and I am ...
7
votes
4answers
262 views

Deleting list elements by comparing to another list

I have two lists as follow. The first is p={{"j","d","x"},{"d","k","z"}} and the second one is: ...
5
votes
3answers
144 views

Select the cases by comparing the second elements of the list

Suppose I have a list: l={{1,4},{2,4},{3,5},{4,6},{5,3},{6,2}} How can I select the elements of the list in the second element is decreasing and first element of ...
1
vote
1answer
49 views

Choosing data from list and plot [duplicate]

I have a data set like below: Angle={5.48575, -0.669213, 45.9832, 8.63878, -16.8777, 50.022, -41.8882, -45.956, 28.3005, 35.8234} Now want to select the ...
2
votes
1answer
71 views

Select the right XMLelement

I scrape data from a public website about houses for rent. All pages have the same structure. But the pages can differ in the amount of information. Below I give two examples: page/house 1: ...
7
votes
2answers
203 views

Select UPPER CASE list items with spaces and punctuation

I have a sample list that includes people's names in Title Case, and their companies in UPPER CASE. ...
3
votes
2answers
82 views

How to filter-out edges in a HighlightGraph[] visualization based on VertexCoordinates[]?

I need to visualize a graph spatially, and I'm simply using: HighlightGraph[ConnectedGraphComponents[]] and the known coordinates of the graph's nodes. I really ...
7
votes
4answers
326 views

How to remove “extra” edges from a multigraph?

I programmatically generate many large undirected graphs. Sometimes these graphs are multigraphs, that is, they contain more than one edge between a pair of nodes. I've tried to delete the "extra" ...
2
votes
4answers
242 views

Smoothing noisy data

I have this data shown in picture 1 below and I want to filter it. I tried some filters but I couldn't get good results. seems that I didn't choose the best parameters for it. I want to smooth my ...
3
votes
1answer
90 views

Applying TemporalData to array before filtering gives wrong results

I had a task of filtering data with various timestamps on it, and proceeded as instructed. The first option was to use TimeSeries which works fine but somewhat slow, and the second one TemporalData ...