# Questions tagged [list-manipulation]

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

9,652 questions
Filter by
Sorted by
Tagged with
8 views

### Unexpected Peaks and Detours in PNJL Model Plot Using FindRoot

I'm working on a numerical solution for a PNJL model. The model I’m working on is based on the formalism described in this paper: arXiv:hep-ph/0506234. My goal is to reproduce plots similar to the ...
77 views

### Automate generation of new list [closed]

Suppose there is a list of lists as follows: BigList={{1,2,3},{4,5,4},{7,7,9},{10,11}} and it is required to apply a given command separately on each sublist ...
• 101
103 views
+50

### Fastest way of removing outliers from a data set which depends on a variable

Edit: I meant $j\to\infty$... Suppose we have the following code: ...
• 57
123 views

### Numerical precision of keys in Merge function

I'm trying to merge list member with the same numerical key values: a = {53.8 -> x, Floor[53.81, 0.2] -> y}; Merge[a, Total] then I get: ...
• 305
109 views

### How to delete members of a list by rule [duplicate]

I have a list: lis = {"a",1,""} and would like to delete from the list all elements that consist of "" to give: ...
• 5,015
80 views

...
• 4,868
1 vote
58 views

• 1,014
282 views

### Drop` for list of elements of different dimensions

MWE is the following list {{{1,2,3},4},{{a,b,c},d}} I want to Drop the 3 and c here. (In reality, it is a very long list of ...
460 views

### How to raise a vector to powers contained in a vector, change the list into a product, and do this for all the lines of a matrix, efficiently?

I want to raise the first vector var to the powers in a second vector, and then multiply the list, when the second vector runs over all lines of a matrix ...
• 1,982
279 views

### How to find intersecting linear equations between two lists?

I have two lists of linear equations: list1 = {x - y == 0, x + 2y == 0, 3x - y == 0} list2 = {-x + y == 0, -x - 2y == 0, 3x - y == 0, 3x - 2y == 0} I want to ...
• 723
45 views

1 vote
85 views

### How to generate all possible combinations subject to symmetry conditions

I have a list of 6 (possibly repeated) integers: ints = {a,b,c,d,e,f}; and also a set of symmetry conditions: You can switch the signs of elements 1 and 4 at the ...
• 575
202 views

### Function to find the most common numeric ordered pairings (value, count)

Let us say that I have a list of numeric ordered pairs where the first number represents a value to be counted and the second number represents the count of that value. The following is one way to ...
• 121
38 views

### Add a new column based on the complement of column data in a table

I have this code to replace the data of each row in a specific function and display a new column showing the values ​​of the function ...
• 1,014
1 vote
59 views

### Finding the position of a list element using functions like Max on lists that might contain 'Indeterminate' values

I am working with lists of the following form: ...
• 121
76 views

### Best way to extend the size and add terms to a SparseArray without expanding

Let's say I have a "small" SparseArray of any size, in the example $2\times2$ ...
• 37k
49 views

### Operations on Sub Lists

Let us assume that I have the following list of lists: foo = {{2, 1}, {3, 1}, {4, 1}, {2, 2}, {3, 1}, {2, 1}}; and that I want to multiply the elements of each sub ...
• 121
164 views

### Union of lists with original order

I would like to combine a few lists such that the resulting list follows the order of the original lists, which will have disjoint elements, but their order is compatible. ...
• 1,112
1 vote
80 views

### How to check equivalence when variables in equations are replaced by their negatives?

In a previous post about checking whether two systems of equations are equivalent, the suggestion was to use the Reduced Row Echelon Form, which was great. However, I now want to consider an ...
• 723
1 vote
81 views

### Reshaping a list as another nested list

I have the following list ( p to be some even number ) ...
• 307
88 views

### Find positions of unique elements in a nested list

I have a nested list with depth 6. The items in the list are mathematical expressions. I want to find the positions of the unique items in the nested list. I have found the following, which works for ...
• 575
210 views

### How to make a list plot from a "vector array"?

I have an (excel) table where my first column have decimals from -3 to 3, and the other columns have associated values, in such a way that i have a "vector array" similar to this: ...
• 43
31 views

### Solving list manipulation exercise involving longest sequence of identical digits in a list using functional programming idiom

I have been trying to improve my list manipulation skills by doing some of the exercises in Wolfram's Intro book. I am struggling to solve this question using only functional programming constructs. ...
• 189
1 vote
159 views

...
• 381
1 vote
48 views

• 673
145 views

### List editing problem

I have an ill-formed list: ...
• 5,015
119 views

### Central element of matrix

Let we have $(2\cdot r+1) \times (2\cdot r+1)$ matrix mat. Is there a better way to extract it's central element, rather than ...
• 1,904
190 views

### Generate a table of elements whose number is equal to prime numbers

I have a list of words (strings) same as ...
• 659
1 vote
71 views

### Randomly replace some letters in words with hyphen

I have a list containing some related words ...
• 659
1 vote
82 views

### Find the feasible solutions of a minimal path set of vectors

Finding the feasible solutions for vectors representing minimum paths based on the mathematical basis: First example I need to create the constraints according to equations (1) and (2) above: ...
• 1,014
1 vote
65 views

### Max and Transpose in the Probability of a Union

If I have the code that gives the probability of the sum in general ...
• 1,014
1 vote
132 views

### Probability of a union with probability function of vector

I want to calculate the probability of a discrete random variable. ...
• 1,014
55 views

### Apply an equation based on two sets with different indexes

Apply an equation based on two sets with different indexes Simple example If I have the following elements in the form of two sets with different indexes: $m=\{m_1,m_2,m_3,m_4,m_5\}=\{1,2,2,2,1\}$ \$p=\...
• 1,014
286 views

### How can I sort all levels except the innermost level?

How can I sort all levels except the innermost level? The number of levels is unknown. For example: list = {{{d, c}, {b, a}}, {{4, 3}, {2, 1}}} If we needed to ...
• 723
78 views

### Other methods extract the x-coordinates and y-coordinates from a list of multiple coordinate values and list them separately in two individual lists? [closed]

x={0.04,0.06,0.04,0.08,0.08,0.05,0.05,0.07,0.07,0.06} y={0.25,0.4,0.22,0.54,0.51,0.34,0.36,0.46,0.42,0.4} The two lists above represent sets of x-coordinates and y-...
• 4,868