Questions tagged [list-manipulation]

Questions on the manipulation of List objects in Mathematica, and the functions used for these manipulations.

Filter by
Sorted by
Tagged with
0
votes
0answers
41 views

How to create a function that extracts a list of data points from a plot

I have a function f[x] that I can plot against x and I would like to create another function, something like Data[x_,LowerBound_,UpperBound_]:= that extracts a ...
5
votes
2answers
94 views

How to subtract two lists based on a key

Let's say you have the following datasets {set1, set2}: ...
1
vote
0answers
32 views

Finding Minimum from List of data [closed]

I have a list of data in the form data = {{x1,y1},{x2,y2},{x3,y3},...} and I would like to find the value of x for when y is minimum from the data set, ideally in ...
0
votes
0answers
21 views

Showing the empty space in a DensityPlot [closed]

When I used the DensityPlot,it showed an empty space.. I don't now where is the probleme. Thank you for your help
0
votes
1answer
25 views

Replacing sublists with criterion or Interpolation for a smooth curve

Supposing we have the following list (very small, can be copied into a notebook directly) ...
3
votes
1answer
81 views

How to get the first value of the duplicate in this association list

I have the following association list. I want to get the first value of the duplicate item, but only the last value. What should I do? ...
0
votes
0answers
44 views

Lookup Table to Produce Extracted Lists

My code below extracts the correct lists, but within each list the output jumbles the order of the elements when the code reads a number like "3" or "3.1" or E (which it sees as Euler's "e") or (A-B0) ...
3
votes
1answer
78 views

Iterative comparison between different vectors

I have some soccer outcomes for each league round to import in a data form similar to that: ...
1
vote
1answer
38 views

First Neighbors in a DiskMatrix

I have the next array: DeleteCases[DiskMatrix[radius], 0, {2}] And I would like to have access to each element first neighbors. How can I have access to those ...
7
votes
1answer
104 views

Merge list repeating elements

Suppose I have a list with mixed elements {{{a,b},{c,d}},{{e,f},{h,i}}} Is there a way so that I can reshuffle the elements to get the following? ...
4
votes
1answer
36 views

Prepending different numbers to sublists

This problem relates to Prepend 0 to sublists I have the list t1 = Table[m = n + IntegerReverse[n]; n = m, {n, 3}, {i, 1, 4}] giving ...
1
vote
2answers
66 views

Highlight pixels in difference image of two images where pixels are not equal

I have two images which are similar. I would like to highlight the pixels in the difference image (e.g. in red) if the values are not exactly 0. How can I do that? I know I can get the image data ...
4
votes
1answer
91 views

count if 2d data contain non zero element pairs

...
2
votes
0answers
66 views

How to use a List in Do-loop?

My program produces a list that looks exactly like this: listr = {{i[1], 0, 13}, {i[2], 0, 21}, {i[3], 0, 41}, {i[4], 0, 5}}; Now I want to use this list in a <...
1
vote
1answer
120 views
+50

Move from the rotating frame of reference to the lab frame for a periodic function

I have a plot in the rotating frame of reference which moves with some constant rate, S. I want to convert this back into the lab frame by using some substitution of the form xAxisPositionLab = ...
6
votes
2answers
163 views

Effectively gather data with small differences

I frequently encounter themes where I have a set of data, then I need to gather up those identical ones. However, due to numerical error in data, GatherBy cannot be ...
1
vote
3answers
55 views

2D Plotting from lists [closed]

Is it possible to do a 2D plot taking the point coordinates from separate lists of x and y values? These lists were produced by calculations within the same notebook. For a small number of points it ...
1
vote
2answers
85 views

Pick out elements from a list of lists using criteria

Consider a list of lists in this form (with a shape $ m \times n \times 3 $): ...
6
votes
2answers
109 views

Removing duplicate rows and appending from a table of lists

For the table x with three lists per row: ...
1
vote
1answer
35 views

Defining variables from an association list

I have list of rules, something like {f[x,y,z]-> F, g[x,y,z]-> G, D[f[x,y,z],x]-> fx,...} I would like to assign the values to the variables like I ...
6
votes
2answers
720 views

All possible combinations of ways to write an equation

I want to define a function in Mathematica where I get all combinations of an expression, e.g., input: {q,p1,p2} Output: ...
0
votes
1answer
50 views

Lists forming figures

I would like to make a list whose elements form a disc when formatted. For example, this list forms a triangle when formatted ...
0
votes
1answer
25 views

building a graph from table of string records and array of keywords

I have a table of records, each record is about a publication onm some topic, the different colums indicating the title, authors, abstract and so on I made a function searchkeyword[string_] that ...
2
votes
3answers
40 views

cleaning up a list of values with no missing data

Im attempting to clean up a list which has missing elements by inserting the mean feature variable into the missing data ...
5
votes
7answers
836 views

Generating list with short code

I need to get this list {1,0,2,1,3,2,4,3,5,4,6,5,7,6,8,7,9,8} with a very small code (< 30 characters) using Table and List functions. On each step, either it - subtracts 1 or - adds 2 I ...
1
vote
1answer
45 views

how to scramble and then unscramble a list of elements?

list = {"a", "b", "c", "d"}; scrambledList=scramble[list] {"b", "d", "a", "c"} unscramble[scrambledList] {"a", "b", "c"...
1
vote
0answers
33 views

how to rotate the elements in a list? [closed]

Given a list of elements: list = {"a", "b", "c", "d"}; What is an idiomatic way to move the first element to the end? ...
2
votes
1answer
76 views

Help: Obtain a huge amount of data solved in FrobeniusSolve? (perhaps better without running FrobeniusSolve?) [closed]

How to obtain a huge amount of data solved in FrobeniusSolve more systematically? I am interested in obtaining these two sets of data from FrobeniusSolve: ...
2
votes
2answers
69 views

Track a moving peak on a periodic ListAnimate plot

I have a ListAnimate plot and I want to track the position of the peak as it moves. Is there any way to do this which takes into account the fact that the peak of the wave moves past the window of ...
0
votes
0answers
47 views

How to plot a series of arrows from a list of vectors?

Suppose I had a list of 3-vectors as a time series like the following: ...
1
vote
0answers
44 views

$ x $ and $ y $ coordinates in ListLinePlot [closed]

I'm trying to make a ListLinePlot with my randomly generated data, and I want one vector to be the x coordinates of the graph, ...
3
votes
5answers
86 views

Decomposing a list into several two coordinate lists

How can the following list can be decomposed into separate two coordinate lists? list = {{1, {0}}, {2, {0}}, {3, {-2, 0, 2}}, {4, {-2, 0, 2}}, {5, {-2, 0, 2}}}; ...
6
votes
2answers
353 views

I'm not able to delete -> in {{x -> a}, {x -> b}, {x -> c, x -> d}}

Here is what I have done. Input DeleteCases[{{x -> a}, {x -> b}, {x -> c, x -> d}}, Rule, {2}] Output ...
1
vote
1answer
72 views

How to evaluate {Subscript[x, 1] == 2, Subscript[x, 2] == 3} , $x_1^2+x_2=2^2+3=7$ [closed]

My code simply can't solve this. $ x_1^2 + x_2 = 2^2 + 3 = 7 $ ...
5
votes
3answers
239 views

Position of a nested list

I have a list of the form { {{1, 2}, 0.395}, {{1, 3}, ∞}, {{1, 4}, ∞}, {{2, 3}, 1}, {{2, 4}, ∞}, {{3, 4}, ∞} } and I hope to find the elements whose list ...
6
votes
3answers
132 views

Split expression into list of terms

I'm looking for a nice way to split an expression into a list of the terms (i.e. the addends). The desired behavior in: ...
5
votes
2answers
80 views

Apply Outer to list of matrices and vectors

I have a list, M, of square $ n \times n $ matrices, {M1, M2, M3, ...}, and a list, V, of $ ...
1
vote
0answers
42 views

Retrieving boundary points of concave hull (or alpha shape) in 3D

I am trying to find the boundary points of some concave 3D region which is described by a list of points. If the region were convex I would take the convex hull and simply extract the coordinates ...
0
votes
1answer
49 views

Accessing the elements of Tables that are stored in Lists

I have a list of Tables Psilist = {psi0, psi1} Where psi0 and psi1 are 2D tables. I would ...
4
votes
2answers
116 views

Removing a nested list associated with a key and inserting into a new list

I'm trying to remove nested lists that are associated with a key ...
4
votes
2answers
178 views

Create a matrix from the rows of another, and calculate the rank of the new matrix

This may be a very basic question, so apologies in advance, I'm a first-time Mathematica & StackExchange user! I have a 7x3 matrix X with all rows being unique in a 2D-list format. For example:...
4
votes
2answers
131 views

Automatic generation of filenames from column values and automatic PlotLegends labels from file names?

I have a two-part question about the automatic generation of file names and Plot Legends, Labels. Part 1: I typically work with very large matrices of data with columns of the form: MASTERdataset: ...
4
votes
1answer
68 views

How to specify Part in [[{…}]] at mixed levels?

In the following example, how to easily get {2,4,10} using the [[{...}]] syntax? ...
0
votes
0answers
41 views

Using If statement to evaluate lists

I have a list of x,y values and i am finding the distance between each point, So for 20 point in my file I have something like this, ...
1
vote
1answer
69 views

Color code and string choice on a table

I have the following Table: ...
0
votes
0answers
32 views

After execution of simple list manipulation every expression turns dark blue and nothing is defined - how to debug

This question is related to this one in the sense that it uses the code from there. What happens is best illustrated in the video here. When I run (* part 1 *) ...
2
votes
2answers
61 views

Rearrange a list according to position association with a new list

I have the following code: ...
8
votes
2answers
156 views

Top few numbers (highest) of a list

If I have a list A = {51, 2, 3, 4, 5, 6, 7, 52, 55}; How do I get the highest three numbers of A to get ...
1
vote
3answers
81 views

Import data from different webpages of the same website

I imported and cleaned the following datasets for england soccer league in order to have home/away rank tables and next round matches: ...

1 2 3 4 5 121