# list-manipulation's questions - Danish 1answer

4.958 list-manipulation questions.

### 1 Staircase like function steps finding

2 answers, 46 views plotting list-manipulation
I am making plots for data, and what I get are some staircase-like plots. Data I have is usually like this, for x and y axis (...

### 2 Select element in unequal nested list and plot

I have two list of data ...

### 9 How to programmatically specify multiple iterators?

3 answers, 391 views list-manipulation iterators
How to use Row[Table[{B[i],0,i},{i,0,2}],","] directly in Do command? I mean that the following command ...

### 2 Matrix Randomization

1 answers, 34 views list-manipulation matrix random
Is there a way to take a 20x20 array and replace 2 random parts of this array with a 2x2 matrix? I've tried rvalues = ConstantArray[r, {20, 20}]; to make the ...

### Enhance performace for custom code

I need to make this code faster and consume less memory. ...

### 3 Groupings of the Elements of a List with at Most $k$ Elements

Given a list with $n$ elements and an integer $k$ I want to get a list with all possible groupings of these n elements in sets with at most k elements. For example, given $n=\{1,2,3,4\}$ and $k=3$ I ...

### 11 Plot list with structure of each item {x, {y, z}}

5 answers, 515 views plotting list-manipulation
Given the data below: ...

### 5 Perform BFS for the 8-puzzle

I've tried to implement Breadth First Search algorithm in MMA, to attempt to solve the 8-puzzle game. But in some cases, I ran out of memory, but on other cases it solves without problem. Here is the ...

### 2 Listing all monotone increasing binary digits

2 answers, 61 views list-manipulation binary digits

### Kernel crash when calling Block

1 answers, 66 views list-manipulation crash
Ive made a module to expand a list by reflections and translations. Here is the block. ...

### 2 Generalisation of a generating function

3 answers, 132 views list-manipulation table recursion
I have asked a question here. I want to reproduce the coefficients of a generating function of the form: $$(1 + x)^2 (1 + x + x^2 + x^3+\cdots+x^n)^{n-1}$$ It is important that $x_0$ and $x_n$ to be ...

### Counting elements in a list

I have a long (approx. 4000 rows) list whose elements are in the form as follows:{{x,y,z},a,b,c}I want to count the number of elements ...

### Increasing the speed of sparse array

I am trying to find a sparse matrix of the size Col x Rows = 16777216 x 1024 where all the elements are 0 except the ones given ...

### 1 Generating a new list according to the values of the elements of a list

1 answers, 38 views list-manipulation permutation
I want to use the command Permute to arrange the rows of a matrix. What I am looking to do is given a list I want to generate a new list which gives me the positions of the elements of the first list ...

### 9 Is there a built-in function I can use to measure the similarity of two trees?

2 answers, 237 views list-manipulation distance nearest
This is a higher level question, and I don't expect a full answer, but maybe a nudge in the right direction would help, or maybe there is a built in Mathematica function that does something very ...

### 1 Replace elements of a matrix with zeros using another matrix

3 answers, 94 views list-manipulation matrix replacement
I have a matrix Mat1 whos columns are ordered as :Col = Flatten[Outer[{#2, #1} &, {0, 1}, Delete[Range[-2, 2, 1], 3]], 1]...

### 2 WeightedData Problem

1 answers, 65 views list-manipulation data
I have two lists, the first one containing energies the second corresponding weights, which I want to combine into a weighted data set by using WeightedData. ...

### How to show decimal points on the axes frames in mathematica?

3 answers, 134 views plotting list-manipulation
I have a set of data g1 and when plot using n1, i got the plot shown in figure below. I need to change the x-axis label from (1,2,3,4,5...) to (1.0,2.0,3.0,4.0,5.0) and y-axis label from (50000,...

### 2 Implement ListPlot with two (or more) lists, not necessarily of the exact same lengths

I'm computing an integral using two different quasirandom methods. (These correspond to the choice of parameters $\alpha_0= 0,\frac{1}{2}$ in the answer of Martin Roberts to How can one generate an ...

### 5 Selecting from a list returned by Tuples

1 answers, 169 views list-manipulation tuples
Select[Tuples[{1, 1/2}, {4, 4}], Total [#] == 15]I want to select all tuples in the result returned by Tuples that have total ...

### 10 Loop over a list of strings and increment letter count in a corresponding sublist

I have a 2D list as follows: ...

### 3 How can I replace non-reals in a multidimensional list?

Ok. I'm obviously not understanding something about pattern matching. I have a list called t like the following: ...

### 2 ListPointPlot3D log scale axes?

1 answers, 23 views plotting list-manipulation
I've been trying to get my y and z axes log-scaled on a 3D list Point Plot, for example (test data): ...

### 1 Extracting the elements from a loop of sets/ lists

I have a list of integers with the zero removed Delete[Range[512/2, -512/2, -1], 257]and I want to get the elements before and after a number within the list. ...

### 8 Delete all strings that are prefixes of another string

I have a long list of strings and I'm trying to find a more efficient way of removing those elements that are prefixes of another: ...

### 5 Move element inside a list

I need to change the position of a single element in a list. Example: I start with:{a,b,c,d,e,f}I want to move the a before ...

### 1 Select rows of data that satisfies both conditions simultaneously

I'm a new user of Mathematica and now I am confused by a problem. Now I have about 2 million rows of data and 3 columns, i.e. a 2million*3 table. What I am trying to do is select rows of data ...

### What is the fastest way to build a simple table?

Question: What is the fastest way to obtain a table of values from a parametrized function? For a function of x, which is a sum of ...

### 12 Data re-structuring by Thread

1 answers, 224 views list-manipulation data data-structures
Thread can do thisThread[{a, {b, c, d}}]{{a, b}, {a, c}, {a, d}}But when above ...

### 1 Randomly merge elements from paired lists to a new paired list

Some background. I can use Mathematica to generate text book problems/exercises and corresponding answer in two "pairs/synched" lists $L_{Q}$ and $L_{A}$ (i.e. element 1 in each list is a Q&A pair,...

### 4 Taking a Part of a Part of a Variable

1 answers, 51 views list-manipulation indexed-variable
Say I have Part of a variable x.Part[x, 1]Then, I'll get an error message, as the ...

### Finding the minimum value in a column and extracting the row where the minimum value placed there [duplicate]

I have a list of random numbers. In each row there 5 numbers. I want to find the minimum value of the first column and extract the row where the minimum value placed there. How can I do it using ...

### 3 how to obtain these increasing integers for given n and m?

1 answers, 55 views list-manipulation integer-sequence for
Let n and m be natural numbers. Then, how does one write a function ordint[n,m] that gives ...

### 7 Evaluate Only Part of a Function

I have a list of functions, each containing none or more of the functions Plus, Times, ...