1
vote
1answer
76 views

Nest Replace Function with different rules

I have a table of data that I want to filter. Any value of zero in the table means that value was not calculated, so it should get populated with the tag "NC". Next the table is filtered for all ...
1
vote
1answer
47 views

Grouping Nested Lists Based on Differing Values of Single Element

I've a list of lists representing k-rows of truth table having n elements each in a nested list consider ...
2
votes
2answers
104 views

Extracting “records” from a matrix

From a rank 3 matrix like ...
2
votes
1answer
134 views

Find positions where two matrices differ

I have two matrices A and B of identical dimensions. What's the simplest (shortest) way to find the indices of differing ...
0
votes
1answer
44 views

Drop last element of parts of a list [duplicate]

just a simple question for now I guess: I have a list: list={{1, 2, 1}, {1, 10, 1}} I simply want to Drop the last element of the two entries of the list, that ...
0
votes
0answers
37 views

Filter sublists that contain a certain value [duplicate]

This question is a followup from appending elements to sublist mergedList = { { {"a","b"}, -1.5, -5, "no" }, { {"c","d"}, -2,-10, 7 } } I ...
0
votes
0answers
70 views

Improving a function that filters each table from a list of tables

I have written the following function which can take in a list of tables as an arguement, and then filters each one. The function I wrote is below, and the commands I combined are listed below the ...
4
votes
3answers
193 views

Conditional search along the columns of a matrix

I want to implement the following algorithm in Mathematica. Get element along main diagonal of a matrix. If the element along the main diagonal is positive, then return the positions of the elements ...
3
votes
1answer
125 views

Select row from a table by column value [duplicate]

I have the following: animals = {{dog, black, 200}, {cat, white, 100}, {moose, brown, 500}, {zebra,black,100}} If this came from a SQL table called animals, ...
2
votes
1answer
85 views

Restoring the 1-to-1 correspondence between elements in two lists, where one list is used as a guide to prune elements from the other

when we wish to use one list to select items from another using something like Pick, writing the following code, for example, causes us to lose the 1-to-1 ...
0
votes
2answers
90 views

How can I select elements that are true

I have a list of lists. For example, list = {{0,1,0,1,true},{0,0,0,0,false},{0,1,1,1,true},{1,1,1,1,false},{2,2,2,2,false}} I'd like to find all lists that ...
1
vote
2answers
155 views

Removing trailing zeros from a list

If I have a list like list1={2334.,342.,0.,0.,2322.,0.,0.,0.,0.,,,,,,}; it's easy to remove to trailing blanks with ...
2
votes
4answers
491 views

More elegant way

I read ReplaceOrRemoveInvalidOrMissingData Mathematica documentation, and I tried to apply the same approach to my dataset. I've got two problems, but one is only a style problem! There is one more ...
9
votes
5answers
489 views

Fast way of finding position of Interval containing an Integer

I have a large list (about 2.2 million) of pairs of integers. Each pair defines an Interval[{}]. Given some integer x, I need to ...
2
votes
2answers
181 views

Plotting data in a weird format

I have a lot of data on the following form: data = {{param1,param2,param3,param4,{{x1,y1},{x2,y2},...,{xn,yn}}},...} The first variables in each sublist are ...
5
votes
4answers
237 views

Using an ellipse as a threshold for Nearest function

The Nearest function can receive as a threshold parameter a radius to look for elements inside that. From the documentation: ...
8
votes
3answers
262 views

Deleting quasi-duplicates from large list efficiently

I have the need to remove "duplicates" from large (>10K members) lists, where a "duplicate" is either a verbatim duplication, or the element's second entry exists as a first entry for some "earlier" ...
0
votes
1answer
117 views

Using DeleteCases with multiple AstronomicalData properties

I am attempting to use AstronomicalData and DeleteCases together to remove invalid cases of two properties while listing the ...
1
vote
2answers
112 views

Computing lists using AstronomicalData

Edit: Initially in my question I asked how I could search the database of AstronomicalData["Exoplanets"] and return 2 filtered values that only contained valued ...
1
vote
2answers
117 views

Deleting parts from a nested list

I have a very long nested list. Here is a short example: list = {{1.2, {1, 1, 1, 1}, {2, 2, 2}}, {0.9, {3, 3, 3, 3}, {4, 4, 4}}, {1.4, {4, 4, 4, 4}, {5, 5, 5}}} ...
0
votes
0answers
63 views

How to delete duplicated sublist [duplicate]

I have a list like this: ...
0
votes
3answers
90 views

How to get the indices of values in a list which are NOT an specific integer?

I got a real array A, where Dimensions[A] == {5000, 5000, 5}. Some of the values in A are ...
6
votes
5answers
234 views

Removing reverse versions of lists from a nested list [duplicate]

I need to remove the reverse versions of lists from list of lists. I.e.: {{1,2},{2,2},{2,1},{a,1,2},{2,1,a}} I need to reduce to ...
2
votes
2answers
144 views

How to delete all rows in datafile that contain a string

I'm importing some data from a file. However, the file was created by an unreliable instrument, such that the data looks like this: ...
2
votes
2answers
202 views

Deleting parts of groups that do not have equal dates

Find the intersection of dates within the pair and remove the other dates & corresponding prices. Also keep the list in same format as it currently is in. Let me explain: Each stock has closing ...
2
votes
1answer
265 views

Extracting a range of data from a table

I have text file with data in 2 columns. I have imported it using the following line c = Import["ab", "Table"]; This text file has a large amount of data, and I ...
9
votes
5answers
2k views

How to find rows that have maximum value?

Suppose if I have following list { {10,b,30}, {100,a,40}, {1000,b,10}, {1000,b,70}, {100,b,20}, {10,b,70} } How to find rows that have max value in ...