# Questions tagged [list-manipulation]

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

6,283 questions
Filter by
Sorted by
Tagged with
122 views

### How to apply Cases on multiple parts of sublists?

I have the following data sol={{2063, 853}, {2066, 855}, {2069, 857}, {2072, 859}} I can find prime-pairs by ...
56 views

### Replace Solution arrow in list of list

I have solutions like ...
64 views

### Shifting fit and its data on x axis

I have the following list: ...
154 views

### How to handle Part function error when position does not exist?

Say a list list={{1,2},{3,4}}, list[] and list[] works. But ...
98 views

### How to group points based on mesh primitive membership

As a simple example of what I want to do, let's say I have a Voronoi mesh in a $10\times10$ area with $10$ random "seed points": ...
35 views

### MapAT and GeoPosition

I just experienced a problem applying GeopPosition via MapAt. Here a MWE. Given a list of data: ...
99 views

### SequenceCases does something odd with RuleDelayed arguments

I have a list of stuff. list = {a, b, b, a, b, a, a, a, b, a}; I want to split it up into subsequences where a single a is ...
169 views

### How can I sort a nested list?

I have a nested list of the form: ...
59 views

### Constructing a List of Functions

I would like to construct a list of Functions that can be used like: F[z][[i]] Where one can choose between list elements with ...
145 views

### Searching for nodes in the network

Let consider the network ('graph'): ...
56 views

I am new to Mathematica. I just want to evaluate a 2x2 Jacobian and then evaluate it on different values of the two variables x and y. The values I want to use to evaluate the Jacobian are the result ...
126 views

### Mapping between lists and Mapping Formats

I've been writing a conversion 'script' between two robot description formats and thought I would try out Mathematica as I thought it sounded pretty awesome. Although by this point I should have done ...
29 views

### Redefine a function on certain values

This question is related to Zero-dimensional matrices, in particular to the answer https://mathematica.stackexchange.com/a/39543/42722. In Mathematica $0 \times n$-matrices are not well-defined, so I ...
31 views

### Using a list to make a contour plot of multiple values

I'm trying to make a contour plot for multiple values of the same function. To accomplish that, I'm doing the following: ...
45 views

### Creating a For Loop to simulate matrix changes

I'm trying to create a For loop (Using the For syntax is a necessity for the future work I'd be performing) for a matrix given by the following lines of code: ...
85 views

### How to find a number that multiplied to a list, returns an all-integer list

I do not know how to code the following. Suppose you have a list lst={x1,...,xn}and you need to find a number $Z$, to a given digits precision such that ...
46 views

### How to select data from list of pairs given that one entry of each element is element of another list

I have data of the following form ...
37 views

### Transforming a checkerboard using Transpose and ReshapeLayers

In the paper for RealNVP, they introduce a "squeezing" operation that takes a matrix and transforms it to have more channels, according to the following transformation (before and after): As you can ...
100 views

### Grouping and repeating the grouped rows inside a matrix

I'm interested in finding the quickest way of grouping the rows of a large matrix in sub-groups based on the position of non-zero elements in the first column and then repeating them number of times ...
46 views

39 views

### Using MinimumBandwidthOrdering to restructure a correlation matrix

I am trying to restructure a correlation matrix such that the variables with the strongest correlations are grouped together Needs["GraphUtilities`"] These are ...
36 views

### How can I rewrite this code so that it gives me the same result in less than one second? [duplicate]

For[i = 1; list = {}, i <= 23456, i++, l = AppendTo[list, i/Pi]]; Total@N@list
1k views

### A clean way to conceptually extract Parts from a circular list

I quite often run into a situation where I want to treat a list as a circular (repeating) list, and want to take a specific sublist of it, such as... One past the end of the list: ...
97 views

### How would you explain Nothing[] weirdness? [duplicate]

I would like to use Nothing[] to make some elements of a list invisible. (The intended use is to remove a few unwanted points from a ...
52 views

### Reassign Lists after adding new elements to the same Symbol

I try to Reassign Lists after adding new Elements as the following Examples: m1 = Table[{"A", "B"}, 3]; m2 = Table[{"C", "D"}, 4]; n1 = Range; n2 = Range; ...
55 views

### Generating vectors with small inner products in a large vector space

I want to generate a large number $k$ of vectors of norm 1 in a $d$ dimensional vector space such that $k>d$. I want these vectors to have inner products as small as possible. A crude way is to ...
77 views

### How to separate and re-order a list of points?

Suppose that we have a list of points. By plotting them we find two curves but the points are in a sequence of first fixing $x$ and then increasing $y$, next fixing $x+dx$ and then increasing $y$ and ...
55 views

### Using Predict to fill in missing data

I am attempting to use Predict[] to fill in the missing data in the dataset below; ...
446 views

### How to remove duplicate elements [duplicate]

How to remove duplicate elements? I want to delete all the same elements in a list. For example, list {1,2,1,2,3,4,5,1}, I want to get ...
129 views

### How to turn {2, 9, 3, 16, 81, 0.09} /. {x_Prime -> Sqrt[x]} into {Sqrt,9,Sqrt,16,81,0.09} [closed]

How to make this below work? Input {2, 9, 3, 16, 81, 0.09} /. {x_Prime -> Sqrt[x]} I wanna turn this list into {Sqrt,9,Sqrt,16,81,0.09}
758 views

### Why does {2, 9, 3, 16, 81, 0.09} //. {x_Integer -> Sqrt[x]} evaluate infinite times? [closed]

Here is my code. {2, 9, 3, 16, 81, 0.09} //. {x_Integer -> Sqrt[x]} The pop-up message ReplaceRepeated::rrlim suggests ...