Questions tagged [list-manipulation]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
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 ...
0
votes
0answers
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 ...
0
votes
1answer
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 ...
3
votes
4answers
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....
4
votes
2answers
218 views

Bug in Transpose in Mathematica 12.2?

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

How to find the minimum Hamming distance?

I have a vector $v = (9, 2, 3, 4, 8)$. Vector space over $\mathbb{Z}_{11}$ is generated by a set: $e_{1} = (4, 2, 0, 0, 1)$, $e_{2} = (1, 9, 0, 1, 0)$, $e_{3} = (5, 0, 1, 0, 0)$, $e_{4} = (0, 7, 0, 0,...
1
vote
1answer
32 views

Creating a rule-based list of lists using Manipulate[…]

Given a list of lists: list = {{x1, x2, x3}, {y1, y2, y3}, {z1, z2, z3}}; Some self-explanatory lists which I like to create using ...
4
votes
1answer
85 views

How to show net income geographically of a company in a certain city

Let's say that I have a company, and I already extracted it's net profit with time series. ...
-2
votes
1answer
78 views

Create table with squares and cubes and colors, how to produce the desired effect?

This should be very simple but I do not get as I want, I have tried, with print, grid, matrix but it doesn't work. Is for my niece, is to create a table of squares and cubes with big bold letters size ...
0
votes
0answers
75 views

Why I cannot see the graph

Why I cannot see the graph? Example: g = RandomGraph[BarabasiAlbertGraphDistribution[100000, 1]] Output: No further analysis of g can be done. Why?
0
votes
1answer
62 views

Get position while matching pattern

I want following imaginary feature : PositionOf Example1) ...
1
vote
1answer
67 views

A question on List of data

Hope you are doing well and have good times. My question comes back to dealing with a list of data and extracting points from it. I have explored my problem within a Mathematica code and I would ...
4
votes
10answers
1k views

Mathematica values new list

I have a list: ...
0
votes
2answers
102 views

Display lists in a table form

I would like to display the lists in a table as in the image. How can I make it work? ...
0
votes
1answer
53 views

AddTo operation to random element of a list yields unexpected results [closed]

I have a list of numbers. I want to randomly select one of those, with a probability proportional to its value, and increment it by one. I tried this simple one-liner ...
0
votes
1answer
37 views

Extract coefficients and terms in polynomial expansion [closed]

I have a polynomial in $a$ and $b$: $$(Aa^2 + Bb^2 + Ca + Db + E)^m$$ How can I construct a table of coefficients corresponding to all different products $a^i b^j$ in the expansion for a defined $m$, ...
0
votes
0answers
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 ...
9
votes
3answers
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. ...
1
vote
1answer
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 ...
0
votes
1answer
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)+...
0
votes
1answer
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 ...
2
votes
4answers
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 ...
1
vote
1answer
35 views

Import list to excel

If I have several lists such as: ...
1
vote
1answer
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} ...
1
vote
0answers
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: ...
2
votes
1answer
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 <...
4
votes
2answers
97 views

Select elements of a list

Suppose we have the following data list ...
1
vote
1answer
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: ...
1
vote
0answers
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 ...
1
vote
1answer
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 ...
2
votes
4answers
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 ...
4
votes
1answer
75 views

Create a new list from given data

Let us consider the following type of data list ...
4
votes
2answers
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 ...
1
vote
2answers
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+...
-2
votes
4answers
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 ...
4
votes
2answers
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 ...
3
votes
1answer
71 views

How to arrange two tables in the following way?

Consider two tables: ...
2
votes
0answers
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 ...
1
vote
1answer
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 ...
6
votes
1answer
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. ...
3
votes
1answer
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 ...
2
votes
2answers
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' ...
0
votes
1answer
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: ...
1
vote
1answer
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 ...
5
votes
3answers
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}] ...
1
vote
1answer
41 views

Apply function using level

The following use of Level is documented, without any example. Let's try some simple codes : ...
1
vote
1answer
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 ...
2
votes
2answers
105 views

Restrict kinds of heads when dealing with level concept

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

Manipulating lists of rules of irregular length

After solving a function I get a list as a set of rules. ...
4
votes
3answers
246 views

Extrude two dimensional list with thickness n

I have a question concerning how to extrude a two dimensional list. There are examples in mathematica forums how to extrude but none of them (as far as i know) discussed how to do it with a list. My ...