# Questions tagged [list-manipulation]

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

5,874 questions
Filter by
Sorted by
Tagged with
15k views

### How to find the phase difference of two sampled sine waves?

I'm trying to measure a phase difference between two Sine functions I've acquired with a computer. I'm uploading one of the .txt files with the data I'm working with here: txt file. To remove the ...
403 views

### Merging different size, different order table

I'm a beginner in Mathematica, so this may be a simple request. I have generated some columns of names and data. I want to merge them into a single list of names, with a column for each attribute. ...
1k views

### How to get data from For loops to plot it?

How can I get data from For loops to use in ListStreamDensityPlot? I tried AppendTo, but it ...
373 views

### Combining nested lists that meet certain criteria for a permutation

I have the following list representing a permutation on 26 characters: ...
1k views

### How to extract and replace submatrix of a doubly-periodic matrix?

How can I effectively extract and replace a rectangular subpart of a toroidal matrix, i.e. one where boundaries are connected at opposite ends? Since the submatrix can overhang the edges, a simple <...
403 views

### Replace values of a list containing words and numbers

I'm trying to import some data in a .txt file which contains numbers and words. I import a list which consists of four rows of measured data acquired with an oscilloscope, but the acquisition program ...
357 views

259 views

### Map efficiently over duplicates in list

I am interested in mapping a function, f over a (long) list which contains duplicates. Since this function takes a while to evaluate I would like to make use of ...
2k views

### how to efficiently apply function to all pairs of a set (and collect the results)

To build a graph, I need to apply a function f[a_, b_] to all pairs of a list (3500 elements). The function itself returns a link ...
227 views

### Building intervals

I'm facing the right know the problem of building intervals to an arbitrary number. The special thing is that the first and the last intervals should have fixed length, while the "middle" ones should ...
199 views

### Using patterns in ReplaceAll to extract elements from tuples at arbitrary depths

Please consider the following: I need to extract from MyList all last parts of each 3-tuple. ...
234 views

### Simpler way to repeat an execution with 2D points?

q has the coordinates of quadrilateral. I can get the output below with brute-force but I want to find a simpler solution, perhaps something like f<-q[[1;;2]]. ...
306 views

### How can I permute a multiset?

I have a multiset {1, 3, 3, 1, 2} and would like to randomly permute the classes like so: {2, 1, 1, 2, 3} or {3, 2, 2, 3, 1}, what is the simplest and most efficient way to do this? In reality the ...
706 views

### Very fast way to do a coordinate frame transform

I need a function that rotates and translates a huge amount of line segments. For example, I have a set of line segments in the form {{x0,y0,z0},{x1,y1,z1}} ...
330 views

### Creating a Nearest function programmatically

I've been trying to work out how to create a Nearest function programmatically. My goal is to produce something similar to this, a hand-assembled function: ...