# Questions tagged [list-manipulation]

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

7,094 questions
Filter by
Sorted by
Tagged with
47 views

### Taking parts of a list. Especially multiple chucks of a list

I would like to gather parts of a list and compile them to a new list. for example the list is: {1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5...}. I need to able to take the 3rd through the 5th ...
51 views

### generate statistical table to complete and then review,How can I generate this exact table?

Good morning everyone I want to generate a data table model with intervals (between 5 and 15) following Sturges rule I want to generate a data table model with intervals (between 5 and 15) following ...
23 views

### How to iterate a Summation function over two variable?

I have a summation function q[i]*f[j] which runs over i and j of same length with different ...
255 views

### How to make a list cyclically adjacent pairs?

I have a list (for example) $\{1,2,3,4\}$. I want a list $\{\{1,2\},\{2,3\},\{3,4\},\{4,1\}\}$ where only the elements that are "cyclically adjacent" in the input list are in the output list....
218 views

### Bug in Transpose in Mathematica 12.2?

*In=* Transpose[{a, b}] returned in earlier versions of Mathematica (e.g Mathemtica 12.1) simply *Out=* Transpose[{a, b}] ...
79 views

32 views

### Mathematica CSV values

I wanted just to add constant to each value. i. e. data = Import["/Users/paul/Desktop/rtm1.csv", "CSV"] And I get ...
781 views

### Is there a neat code to swap elements of a list?

I want to swap the list to make a new list as follows. The code works but I'm wondering if there is a neat code, or an elegant way to do this. ...
40 views

### Remove elements from a tuple with conditions

I have a tuple mytup. Assume two arbitrary elements from the tuples are {a1, a2, a3, a4, a5, a6, a7, a8, a9} and ...
48 views

### How to group terms in an expression according to the powers of their variables?

Let us consider the following non-linear 2nd-order ODE: \begin{equation} \scriptsize{ 2 \zeta q_1'(\tau )+q_1''(\tau )+q_1(\tau ){}^3 \left(\theta +\sigma \left(-\epsilon -\frac{3}{2}\right)\right)+...
29 views

### Recursive addition of vector list to last elements of vector lists

This question refers to an extension of Add list of vectors to list of vectors recursively . I tried hard to complete the problem but now I got stuck. I have vectors ...
147 views

### For all x in {1,2,3}, x is bigger than 4

I am new to ForAll or Exists command. Resolve[ForAll[x, Element[x, Reals], x > 4]] gives ...
35 views

### Import list to excel

If I have several lists such as: ...
33 views

### Joining each element of second tuples to the end of each element of the first tuples [closed]

How can I generate a new tuples by joining each element of tup3 to tup1? For example joining {0,1,1,1,0,-1} from tup1 and {d,0,1} from tup3 to generate {0,1,1,1,0,-1,d,0,1} ...
76 views

### Symbolic add of 32Bit Registers

I would like to perform multiple 32bit word register additions (mod 32 add. with variables of Boolean type shuffled with symbolic type). For this task I implemented a ripple adder function: ...
49 views

### Build a list from events

Say I have a list of elements of type {name, direction, time} where direction can be in or <...
97 views

### Select elements of a list

Suppose we have the following data list ...
86 views

### How to add a vector list to a multiple dimension list of vectors [closed]

This problem is related to Add a vector to a list of vectors. Given: ...
24 views

### Fastest way to do repeated subsample/Intersection calls over large set of vectors

In this answer I found I needed to calculate a bunch of intersections of subsets of vectors, like ...
29 views

### Extracting Y-coordinates for list1, for X-coordinates of list2 while their lengths are not same

I have two lists list1={{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; list2={{1.3,12},{3.2,14},{5.4,15},{7.1,16},{9.5,17},{11.6,18},{12.7,19.7}}; X coordinates from ...
181 views

### Adding more data points to the list by averaging parent data points

I have a list "{{x1,y1},{x2,y2},{x3,y3},{x4,y4},{x5,y5},....,{xn,yn}}" and now want to modify it as below ...
75 views

### Create a new list from given data

Let us consider the following type of data list ...
168 views

### Changing the repeated number on a list

How do I change the repeated numbers in a list randomly such that the numbers are no longer repetitive? I have my list to be A={{3, 1}, {4, 1, 2}, {1, 4, 5}}. Here ...
41 views

### For loop over several arguments with different length each

I have a set of text files named in indexed way d1, d2, d3, d4, d5, d6, d7, d8, d9. I want to read them by Mathematica and export them back with other index names N(s1f1+s1f1), N(s1f1+s2f2), N(s1f1+...
271 views

### Extrude 3D list with thickness n

I have a 3 dimensional list of points which i would like to extrude in z coordinate with thickness n, i.e. z_{i} -> z_{i}+n for all points in z. There is a similar question concerning 2d list where ...
120 views

### bind specific 'Slots' to specific 'Map'

Is it possible to construct a pure function using multiple slots, with the following concept :       Binding   specific slot    to    specific apply or map For example : In this example, To ...
71 views

### How to arrange two tables in the following way?

Consider two tables: ...
29 views

### Convolution for large arrays went wrong [closed]

I am trying to use ListConvolve[a, b, {1, -1}, 0] for large arrays a and b (1024 length) to ...
59 views

### How to flatten the given table?

Consider a table Table1 = Flatten[Table[{x, y, {f1[x,y],f2[x,y],f3[x,y]}}, {x, 1, 2, 0.001}, {y, 2, 3, 0.001}],{1,2}]; Could you please tell me whether it is ...
78 views

### Splitting a set of integers over a set of bins

I have a problem that feels like it should be simple but I'm just drawing a blank on. I've got a set of integers, e.g. ...
50 views

### identify sequence in a list

I have a large list of real numbers, that vary between a maximum and a minimum. For the sake of an example: megalist=RandomReal[{-5, 5}, 10^4]. Now, I have a much ...
59 views

### List X is a starter of List Y

For lists X and Y, let's define a term 'X is a starter of Y' to be 'there exist a list Z such that Y = Join[X,Z]'. Until now I've used following code for 'X is a starter of Y' ...
40 views

### Add list of vectors to list of vectors recursively

This question relates to Add a vector to a list of vectors whereas here I want to add list of vectors to list of vectors recursively. Given: ...
25 views

### Replacement rule from list to powers

I would like to write a replacement rule that gives all the possible products of traces for a given length. For example, all the possible partitions of length 3 can ...
240 views

### How can I reorder levels of a list in a performant way?

I have the following problem and I am not sure how to speed it up: I construct a list element by element like so: a[[i]]=Table[some_function[j,k],{j,1,3},{k,1,6}] ...
41 views

### Apply function using level

The following use of Level is documented, without any example. Let's try some simple codes : ...
36 views

### Applying FoldList using a Function

Given p={2, 3, 5, 7, 11, 13, 17, 19} I want to get the values which can be calculated by ...
105 views

### Restrict kinds of heads when dealing with level concept

In Map[(# + 7) &, {a, 3 b, {c, d}, e}, {2}] Out {a, 10 (7 + b), {7 + c, 7 + d}, e} But I want feature like ListMap : ...