# Questions tagged [list-manipulation]

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

7,284 questions
Filter by
Sorted by
Tagged with
86 views

### What is the difference between Catenate and Flatten? [closed]

I am having a hard time understanding the difference between Flatten and Catenate. Consider the following example code: ...
39 views

### select subset of combinations based on condition

My question is about choosing a subset of combinations within a list, based on a condition. Fot example, a shop sells 26 products. The name of a product starts with a letter. Each product has a price. ...
41 views

### Extract a row from dataset based on two strings

Say I have a list as below: ...
104 views

### Permutations with Repetition

I am working with a function of type F[a,b,c,d,e,f] that obeys the following symmetries: ...
223 views

### Split list by sequential entries

I have a list with some entries being sequential and some not. I would like to construct a list of lists split by sequential entries. In this context, sequential means the integer value increases by ...
50 views

### accessing and modifying matrix element

I basically want to do the following A = Array[0 &, {4, 9}]; a = {2, 3}; A[[a[], a[]]] = 1; A // MatrixForm but with less cumbersome notation.(i.e. ...
49 views

### Contour plot of a constant y? [closed]

I have the following data points, ...
62 views

### Gather list items by position [closed]

I have the following list: list = {{a, b, c}, {d, e, f}}; Independently of the size of each sublist (...
39 views

### How to separately pass elements of a 3D list as part of the arguments of a function

Hi I have a function which its arguments have the form F[a,b,c,d,e] but the 2nd to 4th arguments are in a list of the form R={{{b,c,d},{e,f,g}},{{h,i,j},{k,l,m}}} how can I pass these elements as ...
156 views

### List correction

I have a list of games, locations, and dates in the following format: lis = {date, firstTeam, firstScore, secondTeam, secondScore, location of secondTeam} Location ...
106 views

### Is it possible to improve a code related with iterative closest point (ICP) algorithm?

I am trying to write a code related with ICP algorithm. The purpose of the code is matching a target data with a reference data by translational operation in XYZ axes (3-degree-of-freedom (DOF) ...
181 views

### How to manipulate the colours when joining points in ListPlot

Suppose I plot out two sets of data on the same graph as follows: ListPlot[{{{1, 1}, {2, 2}, {4, 4}}, {{3, 3}, {5, 5}, {6, 6}}}] The colours of the points change ...
24 views

### CDF is not working in webpage

This is the first time when I am trying to put my interactive dashboard into my website. But it is not working. These Ways I followed: 1- Save the .nb file to .CDF file format. 2- Use the "...
179 views

### Delete duplicate from list of lists with unequal lengths

I have a list of lists with different lengths, it is of the form { {{1,2},{3,4}}, {{5,6},{7,8},{25,-1},{-14,-3}}, {{1,2}}, {{5,6},{7,8},{22,-1},{-11,-3}}, } It ...
56 views

### How to find all functions that accept level specifications as an argument?

How can I find a list of every function that takes a level specification as an argument?
62 views

### How to swap keys and values of an association? [duplicate]

How do you swap the values and keys of an Association in a manner similar to taking the transpose of a two-dimensional matrix or nested list? I am trying to solve the Wolfram Challenge Capital Cities ...
129 views

### How to Create an Efficient Word Square Algorithm?

I am working on the Wolfram Challenge Babbage Squares. I have looked at the following resources in order to come up with an idea for how to find all the possible word squares: Word Squares and Beyond ...
39 views

### Contour plot with x, y and z values?

I have x , y and z as x = List[1.355, 1.357, 1.359, 1.36, 1.357, 1.355]; and ...
55 views

### A question about Ordering command

We have the following list: list={a,b,c}; Subsequently, we apply the Ordering command to the permutations of the previous list, ...
2k views

### Is there a simple way to convert {a,b,c} to a,b,c?

I need to use: Composition[G][x] In the elements of the following list: j = {{a, b, c}, {c, b, a}}; That is: I could do: ...
57 views

### How to get List element after [[ ]] operation [closed]

How to get the first and second element in every last column from every row? eg. {{7,8}, {3,3}} ...
111 views

### How to obtain all subsets of a list with repetition?

I'd like to generate all lists of length m containing all possible element combinations from a given list of length n with ...
43 views

### How to optimize time to obtain large data set? [duplicate]

I would like to generate a set of data of matrix of size 1000 x 1000 x 1000 in a region defined by 0 outside the sphere of radius r=100 centered in the coordinate (500, 500, 500), and number 1 inside ...
42 views

### Check if two elements exist in a list

I would like to know how i can determine if two elements in a list exist. For example the setup would look like this: ...
137 views

### Sort nested list by a fixed order

I have a nested list like this one: list={{{a,1},{b,3},{c,5}},{{b,1},{c,3},{a,5}},{{c,1},{b,3},{a,5}},{{a,1},{c,3},{b,5}}} Now I need to sort the list such that the ...
46 views

### How to create a simple transformation function on lists using short form of ReplaceAll?

I can easily do this with Map so the real goal of this exercise is to get a better grip on using transformation rules. Please help with this. The outputs should be ...
425 views

### Group points which on several straight lines

I have some points, they are distributed on three straight lines, how to group points on the same line? I have tried FindCurvePath, but I got the wrong result. I ...
466 views

### Generating a list of integers that sums to zero

Given a pair of integers n and k, I want to generate all lists of integers of length n, ...
44 views

### Interpolate function against time

I have two vectors called lammdaWind11 and timeWind11. They are of size 51*1. I have interpolted each one independently as ...
230 views

### Shift the value of the elements in a list

goodmornig, I have a list of numbers like this: ...
89 views

### Using Table to Assign Values for the Index

I would like to assign values for the two indexes at the same time. For example: Table[x + y, {x, {1, 2, 3}}, {y, {1, 2, 3}}] will give me an output of: ...
95 views

### How to reorder a 3d (m x n x n) array to extract an n**2 length list of sequences of m points

I have a 900x100x100 array of floats called 'data' which is essentially 900 frames of 100x100 pixels. I want to extract 10,000 sequences of 900 values each. These are essentially the time series of ...
42 views

### Finding the list where the minimum is

So I have the following lists: TolRin=0.2; TolRout=0.1; TolC={0.02, 0.05, 0.4}; TolL={0.02, 0.05, 0.3}; I want to find the minimum on this lists and I know that Min can do that https://reference....
44 views

### Split list based on a threshold

Problem I have to split a list into multiple lists whenever any element of the list is above a certain threshold. The last element of my list is always zero or less ...
1k views

### How can I use fast Fourier transform (FFT) to solve a PDE (heat equation)?

I'm trying to solve a one-dimensional heat equation (PDE) with the Fourier transform numerically, in the way it was done here. The equation: , is subject to the initial condition: , where U(x,t) is ...
94 views

### Subtract lists in a list of lists

I have experimental data where every run is stored in subsaves, e.g. Run 1 has subsaves run1.1, run1.2, run1.3, run1.4. and the data are cumulative. I import the data of a run using ...
66 views

### Argument of maximum value of a table in range

I have data = {{817, 501}, {818, 549}, {819, 562}, {820, 534}, {821, 534}, {822, 535}, {823, 516}}; How to find argument "822" for 535 (which is the ...
50 views

### Deleting elements of a list with a condition [closed]

I have a long list of number-pairs, like this {{a,b},{c,d},{e,f},...{y,z}}. I need to delete some elements if its 2nd number is less than a threshold ...
47 views

### Numerical minimization of function

So I have the following equation: 3 Sqrt[9.15753*10^-6 + 25.1556 TolC^2 + 25.1556 TolL^2]==1; Now TolC and TolL can take respectively the values of these lists: <...
36 views

### Flatten a pair of matrices within a list of matrices

I have a list of matrices, which I think is better to give an example using the code. ...
186 views

### How to locate a value from a list

I made a list with two values in each cell. ...
47 views

### Formatting list by applying Re and Im [closed]

I have a list of the form $$\{\{ a_1, b_1\}, \{a_2, b_2\}, \cdots, \{a_n, b_n\}\},$$ where $a_1\in\mathbb R$ and $a_2\in\mathbb C$. I want to change the list to \{\{ a_1, \mathrm{Re}(b_1), \mathrm{...
41 views

### Count number of entries based on date

I have the following sample data: ...
87 views

### How to find non-zero integers in a list containing zeros and times? [duplicate]

I have lists like {0, 1, 0, 3, 0, -t2, 0, -(1/t2), 0, 0, 0, 0} including zeros, non-zero integers, and times. I wonder how I get the position of all non-zero ...
62 views

### How to manipulate functions?

This is probably a simple question, I have matrix a , and I construct b from a by adding a variable to the first column. b is a function of variable d, and now I need to do mathematical calculation on ...
189 views

### How to set deeper patterns in arguments within function definitions. For example if an argument must be a list of 1 or more strings

Suppose I want to define a function whose argument must be a List of only Strings and List must have at least one member. I know how to require that the Head must be a List but how does one qualify ...
109 views

### Map a function to irregular matrix column major_order

Suppose I have an irregular matrix ...
50 views

### How i can add an element of one sublist to other?

I have list. st = {{1, 2, 3}, {}, {}} It is nessesary to add the first element of any sublist to start of other sublist. In a quick way. Example: from 1 to 2 ...