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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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.

7
votes
4answers
211 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: ...
4
votes
2answers
111 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
45 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: ...
6
votes
2answers
175 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
75 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
244 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" ...
0
votes
5answers
178 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
86 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 ...
11
votes
1answer
129 views

How to delete lists that contain sublists of different sizes?

I hope to have your help, if I have listp = Permutations[Range[7]]; With the following functions, I delete the lists that contain ...
8
votes
1answer
224 views

Sample rate severely influences quality of ButterworthFilterModel?

I've hesitated for a while about whether this should be posted to dsp.SE or not, but still decide to discuss it here. Today I was playing with ...
2
votes
1answer
85 views

Butterworthfilter highpass/bandpass

this should be a fairly straightforward question since Mathematica has included functionality to filter data. Nevertheless, I am not being successful to solve the problem. Following the proposed ...
5
votes
4answers
453 views

How to increase the speed of DeleteDuplicates on some selected columns?

I have a data1 with 4 columns and would like to remove the duplications by looking at the first 3 columns. Thus I used below code:- ...
4
votes
1answer
46 views

How to select only some values of an association based on some criteria

Here is the association I have: assc = {"abc" -> 2.456, "efg" -> 3.652, "_final" -> 6.108} I need to remove all key-value pairs where keys start with '_'...
0
votes
2answers
65 views

eliminate product terms in equation [duplicate]

I would like to eliminate all terms that contain the product of dxy, dwz, and dxz, i.e. the final result should read as dxy +b dwz+ c dxz. Thanks in advance for any hint. ...
2
votes
1answer
46 views
3
votes
2answers
91 views

Need help charting school shootings by year and number of victims

For my school project I've decided to take some data from Wolfram. I have the dataset from Data Repository, and I want to create three BarCharts. The first one shows the highest number of fatalities. ...
4
votes
2answers
64 views

Deleting elements from a list based on their relative position to one another

I have a data set where I often get pairs of spikes that occur randomly but the pair is always separated within $n$ places of each other. I.e. the spacing between the pairs, in index, is always ...
4
votes
3answers
172 views

Keep only rules that replace integers with other integers

Let's say I have a list of replacement rules: List1 = {2 -> 3, b -> 5.5, 6.57 -> 2, 3 -> 4.5, 1 -> -1, 0.03 -> 0.5, 9 -> a} The desired ...
3
votes
1answer
45 views

Deletion of list elements containing a string character

I have a list: lis = {"ab","a-1","1-20"} from which I need to delete elements of lis that has (only) digits on both sides of the hyphen, in each element that ...
1
vote
2answers
50 views

Selecting elements in nested list

I want to compare elements in a list that looks like this ...
4
votes
4answers
121 views

delete an element list recursively

I have a list, say {10,9,8,7,2,3,5,4,3,2,1} What I want to achieve is to delete the elements that are not in decreasing order recursively. Namely, the output ...
1
vote
0answers
55 views

Filtering list using function values [closed]

I have a list (Basis) of size $2^{21}$, and a binary function $A$ defined on it (only outputs 0 or 1). I want to filter out the items from Basis that $A$ sends to 1. I was able to find the size of the ...
0
votes
2answers
49 views

Remove a term which includes a defined variable from an equation

Is it possible to remove a term which includes a defined variable from an equation? my equation is something like: ...
2
votes
1answer
27 views

Problem with Select using a Part [duplicate]

I have the following dataset: ...
5
votes
1answer
70 views

Find centroids and average intensities of regions in an image

The image below shows an approximately triangular array of bright spots. The intensity falls off towards the edges (Gaussian decay). There are some defects (the elongated smudge and the sharper ...
0
votes
0answers
23 views

KalmanFilter fails

I want to use a Kalman filter to reduce the noise in a time series. The underlying process has no dynamic and therefore can be modeled as an AR(1) process like a random walk. ...
4
votes
2answers
74 views

Filtering data with timestamps

How to apply filter to data that was sampled in certain moments of time? Examples from documentation deal only with uniformly sampled data: ...
0
votes
0answers
37 views

How to negate a boolean selection criteria

I know how to select from a list using a boolean function: Select[list, MyFunctionQ] But I can't figure out how to negate this. I've tried ...
5
votes
1answer
155 views

Counting a part of the speech in a sentence

I want to count a number of nouns in a sentence. For that, I'm using TextStructere but I don't know how to get tags of each word.
0
votes
1answer
44 views

Finding integers that do not appear on list [closed]

Let's say I imported a large list of numbers into Mathematica, and found the min value and max value. In that range [min,max], how do I find all integers that do not appear in this list? ...
0
votes
3answers
47 views

Select Elements from a List which are of the form

I have this problem: Produce a list of those of the first 100 primes which are of the form 8k + 1 for an integer k. So far I know how to create a list of the first 100 Primes, simply using; ...
0
votes
1answer
59 views

Finding sequences of same elements in a vector

I am trying to effectively find a number which tells me the number of sequences of ones in a vector of zeros and ones. For example, consider the vector: ...
0
votes
1answer
36 views

Selection based on truth table

This is probably an easy one… I have a list and truth table for example list = {a1, b1, c1, d1}; truthTable = {True, False, False, True}; Based on the ...
1
vote
3answers
79 views

Removing elements of a nested list based on tests with previous and next element

I have several time series data, each one looking approximately like this: ...
5
votes
2answers
185 views

Strange behavior of Pick when named constants appear in its arguments

Basic problem This is the briefest working example I have found of the problem. Pick[{2 E, 2 E }, {0, 2 E}, 0] {2 E, 1} I ...
0
votes
1answer
30 views

Delete a large pattern from one list

I have this list:IndividualsPossible ...
5
votes
2answers
225 views
1
vote
1answer
140 views

Filter a nested list based on conditions on its elements

I have a large ordered list of lists of integers like this set={{3,4,5,6,7,9},{1,2,3,4,5,6},{3,4,5,6,9,10},{3,4,5,6,11,12},{3,4,6,9,11,12},...} and I would like ...
0
votes
1answer
101 views

Selecting rows from a table based on condition of individual columns

I'm trying to select all rows from a data set based on a condition off of columns within the data set itself. Broadly what I'm trying to achieve is: ...
1
vote
1answer
61 views

Extracting blocks of “adjacent” XMLElements

I have a file that, when imported as an "XMLObject", returns an XML object that possesses this general structure: (I've stripped the inconsequential junk wrapping ...
1
vote
1answer
71 views

Removing outer concentric circle picked up by ComponentMeasurement

So I have performed EdgeDetect and ComponentMeasurements on my images and obtained a pretty good elliptical fit. However, the black shadow of the beads in the image is being picked up by ...
2
votes
3answers
91 views

Conditional selection of rows from a dataset

How can one select rows "a" and "b" from the following dataset where "b" values are larger ...
0
votes
2answers
52 views

Part specification error when reading a column [closed]

I have a ReadList of just some real numbers, called data. I'm trying to extract the data of specific columns from my list. When I execute the following ...
5
votes
3answers
116 views

Changing deep parts of expression specified by complex query

asso = <|"x" -> { <|"a" -> 5, "b" -> "y", "c" -> {5, 6, 7}|>, <|"a" -> 6, "b" -> "z", "c" -> {}|>} |> I want to ...
7
votes
1answer
120 views

How to make Cases work with associations?

Consider the following association of associations: ...
12
votes
1answer
287 views

Ordered RandomSample

This feels like a basic question yet I failed to find an answer. ...
4
votes
1answer
102 views

Using Position[] inside a Module

I have a dataset with missing or wrong values. A module should replace those values so that the dataset length is preserved. For identifying the positions to be replaced I use ...
1
vote
1answer
68 views

Remove large spikes in data set

I need remove large spikes on my dataset that looks like this: I would like automatically replace the spike with data shown in dotted red segment. Is it possible if I choose the spike interval by ...