Questions tagged [list-manipulation]

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

548 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
0 answers
166 views

Find algorithm or generator formula with automated procedure and pattern recognition

I am trying to find a generator formula for the discriminant of a polynomial and believe it would be an interesting problem for the Mathematica community to know how to automate evaluation of certain ...
Hirek's user avatar
  • 483
2 votes
0 answers
213 views

Problem with ParallelTable?

I am trying to numerically solve Bloch equations using Euler's method. My code is the following ...
user64620's user avatar
  • 581
2 votes
0 answers
161 views

Compilation of a function that needs to call Subsets

I'm working on a code that runs many (easy) operations on combinations (subsets) of different size (6, 7, 8, 9) taken from a big set of numbers (normally more that 40). So, this means the code has to ...
bobknight's user avatar
  • 2,037
2 votes
0 answers
141 views

How to create a complex variable from dated list values

Can anyone help me to construct a variable "PI" from values of variable x. Variable x represents a group of two time series rj and ri on equal dates(joined two dated lists with states).Variable x have ...
Branimir's user avatar
  • 171
2 votes
0 answers
133 views

An efficient way to merge a pair of 4d arrays of non regular length lists

Question I have two 4 dimensional non regular length lists of complex values. I have working code however it seems quite slow and I am not sure how I could improve this. Mathematically I am trying ...
User's user avatar
  • 153
2 votes
0 answers
706 views

How could I make an Excel-like table?

I am looking to build a simple Excel type of a table with four columns. I have spent some time researching Mathematica documentation, but haven't come across a way to implement that. Here is a picture ...
Mike2006's user avatar
2 votes
1 answer
381 views

Generating a variable size table one element at a time

I can produce a variable size list of strings like AACBBAABC with this code: ...
Ron Gove's user avatar
2 votes
0 answers
91 views

The number of real values assumed by combinations of complex roots of a decic

Define complex conjugate as the pair of complex numbers $a+bi,a-bi$. Assume you have 5 such pairs and they are the 10 roots $x_i$ of a 10th-deg equation with integer coefficients. In general, how many ...
Tito Piezas III's user avatar
2 votes
0 answers
150 views

Need an explanation on how code from journal works

I was reading a paper from Mathematica Journal. It gives code for calculating subsets. ...
Pankaj Sejwal's user avatar
2 votes
0 answers
150 views

correct usage of ParallelTable

I am trying to parallelize my script. Here is a MWE of how I have done it: ...
BillyJean's user avatar
  • 1,233
2 votes
0 answers
675 views

Generating a function which outputs possible chemical reactions

I want to make a list of chemical reactions and I write them down in a $\require{mhchem}\LaTeX$ format. They are of the following form $$NA_n^i+MB_m^j \rightarrow \hat NA_{\hat n}^{\hat i}+\hat MA_{\...
Nikolaj-K's user avatar
  • 1,485
1 vote
0 answers
98 views

Optimize grouping of list of lists by elements

I have a sorted list of lists of size ~200,000 x 3. The data are such that the first element of each triplet loops through i = 1, 1.1, 1.2, ..., 199.9, 200, and for every value of i, the second ...
TradeMark's user avatar
1 vote
0 answers
52 views

Fitting experimental data to a plot with different x-axis paths

Given Mathematica code of eigenvalues in different variable-paths , I want to add experimental data in the path Gamma-X ; X-Gamma ; and M-Gamma . Here is the code : ...
Med Ch's user avatar
  • 117
1 vote
0 answers
53 views

SameTest for arrays of points

I need to gather arrays of points by some intuitive SameTest, so for some tolerance the next arrays will be treated as the same: Next code looks like suitable for ...
lesobrod's user avatar
  • 1,197
1 vote
0 answers
63 views

How to remove curly brackets from a list of functions?

When I'm creating a plot I standardize the format by predefined parameters, like: ...
Cptn Bluebear's user avatar
1 vote
0 answers
43 views

Finding and manually weeding out images in ClusteringComponents clusters

I have processed images using the following code, where list1 and list 2 are x and y axes, sample of images: ...
atomic-muclei's user avatar
1 vote
0 answers
164 views

How to show the limit of two functions in a code approach zero?

I don't know how to shorten the program, the entire code is required to understand everything: ...
Arbuja's user avatar
  • 39
1 vote
0 answers
46 views

How to join common dates on a TemporalData set with TimeSeriesThread (possible Bug)

Bug introduced in version 13.2 or earlier WRI have forwarded the problem to their developers. Case Number 5029803 I am trying to join TemporalData with many paths ...
IntroductionToProbability's user avatar
1 vote
0 answers
64 views

How to Name a Path in TemporalData?

Preamble: I am working with stock prices and need to perform calculations on them. And then extract the information for further calculations. TimeSeries/...
IntroductionToProbability's user avatar
1 vote
0 answers
52 views

Selecting elements with a particular slope

I have a dataset for which I want to identify 'groupings' based on three criteria, but only one of them is giving me a headache. The criteria are that each group must: have a minimum number of points ...
alex's user avatar
  • 1,396
1 vote
1 answer
44 views

ListInterpolation of a geopath list of lat/long without reformating?

I have a list of lat/long pairs and would like to interpolate. Sending the list of lists of lat/long directly to the first form in the documentation as ListInterpolation[{f1,f2,..}] noting "The ...
Paul 's user avatar
  • 11
1 vote
0 answers
50 views

Comparing performance of `ParallelMap` with pure function

Test data are here: q = CloudGet[ "https://www.wolframcloud.com/obj/874e3b18-808a-404a-aaa0-4e3ad1ac4668"]; I construct interpolation and an equi-...
atapaka's user avatar
  • 3,733
1 vote
0 answers
57 views

Report sum of each list seperately

I'm looking to calculate the variance of the total of multiple lists. To do this accurately I will need each list sum to be reported separately, and recorded in a list, to then perform the variance ...
Schaef's user avatar
  • 163
1 vote
0 answers
132 views

SortBy the second element in the sublists

Is there a way to sort sublists in a list by the sublists' second element? For example, if the list is: ...
Y. zeng's user avatar
  • 425
1 vote
0 answers
133 views

Why is my module saying "cannot assign to raw object" when I run it more than once?

I am trying to solve the shortest path problem in Mathematica. My code looks like this so far. I first import the list. ...
FlashWayneArrow's user avatar
1 vote
1 answer
168 views

ListLogPlot for positive and negative values

I am trying to plot the following set of points on Mathematica: ...
David Raveh's user avatar
1 vote
1 answer
132 views

How to separate parameters from a list based on certain conditions?

The following codes create a table of parameters Br and Dr based on corresponding parameters b and c. How to separate/divide the list/table of Br and Dr for which corresponding b or c are negative ...
Dibbo123's user avatar
1 vote
0 answers
49 views

how i convert lists' elements x to this lists' elements y and how i get elements from nested list?

i have nested list as follows x = {{x11, x12, x13}, {x21, x22, x23}, {x31, x32, x33},{x41, x42, x43}} = {{1, 3, 5}, {3, 4, 3}, {2, 6, 7}, {2, 6, 8}} i want to make ...
Ahmed's user avatar
  • 369
1 vote
0 answers
36 views

Generating a table of lists following the set of rules

I am trying to generate a table of degree sequences for simple connected graphs for a given number of nodes. Example output for $n=4$: ...
Oleh's user avatar
  • 81
1 vote
0 answers
63 views

An error in the short form of a two-dimensional array?

I noticed very strange behavior in the function Short when applied to a two-dimensional list of real numbers in Mathematica 12.3. Consider that ...
Ed M.'s user avatar
  • 101
1 vote
0 answers
40 views

Efficient construction of a formal polynomial using list manipulations

I have a code which is probably extremely inefficient given my inexperience with Mathematica list manipulation. Take as input data: ...
Benighted's user avatar
  • 1,327
1 vote
0 answers
33 views

Placing plots around a circle with SectorChart

I need to position some graphs around a circle so that each occupies a sector. There're 18 graphs in total and the first five are shown below: ...
Rodrigo's user avatar
  • 1,304
1 vote
0 answers
83 views

How to DeleteDuplicates from a list of Rules having set to different values whereby we wish to drop the last occurrence?

About This Function This will eventually set default values for Options based on the end users preferences so that no OptionsPattern need ever be set. The symbol<...
Jules Manson's user avatar
  • 2,397
1 vote
0 answers
57 views

Reading *ptw files into Mathematica

I have a SWIR camera that outputs raw image files in *ptw format. I need to read them into Mathematica for image analysis. I know that such files can be read into Matlab and C++, so there must be a ...
barb's user avatar
  • 11
1 vote
0 answers
104 views

How to fix Mathematica crashing in the following case?

I have a problem with Mathematica when trying to glue two tables together. The tables have the form ...
John Taylor's user avatar
  • 4,642
1 vote
0 answers
71 views

Dividing list into smaller list using a set of rules?

Suppose we have the list for $n\in\mathbb{N}$ Range[1,n] We choose the number in the list where $x=1$, $x=n$ and $x=1+(n-1)/2$ round closest to and the numbers ...
Arbuja's user avatar
  • 39
1 vote
0 answers
85 views

Find invariant tensors under two matrix

I have two $9\times 9$ matrices $g_1, g_2$ where ...
Vayne's user avatar
  • 51
1 vote
0 answers
87 views

Selecting the Nearest First

Imagine I have the following list ...
sam wolfe's user avatar
  • 4,157
1 vote
0 answers
92 views

Inconsistency of interpreting TableForm inputs

Bug introduced in 12.3.1 or earlier and persisting through 13.2.0 or later. Consider this line of code and its result: ...
polfosol's user avatar
  • 952
1 vote
0 answers
91 views

Set w/Log steps to generate a Table

I'm trying to generate a Table with data with the form data=Table[{x1,x2,expr1},{x1,x10,x1f,x1step},{x2,x20,x2f,x2step}] In the context of my ...
nuwe's user avatar
  • 625
1 vote
0 answers
87 views

Extension of /@ operation

If I want to extend this useful operation /@ into a "matrix" version, say for example (#1*{Cos[#2], Sin[#2]}) &/@ ...
Apocalypse's user avatar
1 vote
0 answers
44 views

Sortable Grid-like control for large data sets?

I've been using a roll-your-own function for a while that's a wrapper around Grid which adds a couple things I always use, like headers, dynamic sorting, filtering, and clipping (only showing the ...
Trev's user avatar
  • 763
1 vote
0 answers
68 views

How to create this list

Suppose I have two kinds of operators $a[i,j],a^\dagger[i,j]$ where i is a non-negative integer and $j=\pm 1$, I want to create a list containing all possible products of $ a^{(\dagger)}[x_1,j_1]a^{(\...
Vayne's user avatar
  • 51
1 vote
0 answers
34 views

What subsequences does SequenceReplace consider

Consider SequenceReplace[{a, b, x, x, a, c}, {a, e_} :> e]. What subsequences does SequenceReplace consider? The ...
user106860's user avatar
1 vote
0 answers
48 views

Error using list of discrete variables with WhenEvent

I came across an error when using a list of Discrete Variables with NDSolve and WhenEvent. As you can see in the minimal example, where I defined the 'testevent', when I use ...
Tim's user avatar
  • 115
1 vote
0 answers
100 views

"Total" function for a Boolean expression

I have a very long vector of the form ...
AlbaCL's user avatar
  • 327
1 vote
0 answers
70 views

How does this FromDigit module work?

I am entering the following input: ...
titanium's user avatar
  • 181
1 vote
0 answers
83 views

What is "Flatten" doing to my elements?

Here's some of my code. x1 results in returning the position of a list in a {{{n1}},{{n2}}...}. Im trying to flatten it such that the list reads out as {n1,n2,n3....} some how it's adding elements. ...
MT Cup's user avatar
  • 11
1 vote
0 answers
64 views

Problem using KarhunenLoeveDecomposition

I have a matrix called stochasticData.mat which size is 211302*50 and I need to perform the Karhunen-Loève decomposition on it to calculate the uncorrelated random variables. Note that stochasticData....
slow_learner's user avatar
1 vote
0 answers
85 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: ...
Bogdan Sofalca's user avatar

1 2
3
4 5
11