Skip to main content

Questions tagged [list-manipulation]

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

546 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
0 answers
164 views

BinLists for list of depth greater than 1

Bug introduced in 9.0 or earlier and fixed in 10.3.1 or earlier BinLists uses the bin specification assuming an interval that is closed on the left and open on the ...
Kelly Lowder's user avatar
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
216 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
167 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
143 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
134 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
734 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
384 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
151 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,273
2 votes
0 answers
682 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
55 views

How can I efficiently gather similar lists?

I want to gather similar lists by the function sameQ below. Gather works well here, but it's too slow for large data. My real <...
internet's user avatar
  • 613
1 vote
0 answers
53 views

Random replacement in array

In the spirit of this interesting article of Stephen Wolfram I also decided to study some issues related to mutations. I’m working with simple {0,1} arrays and I’ve ...
lesobrod's user avatar
  • 1,729
1 vote
1 answer
47 views

Define certain argument in functions which depend on several arguments and built in a list

I got confused working with list of functions of two variables. I construct few lists of functions, one is vector of functions List1 and another is 2D list of ...
seva011's user avatar
  • 316
1 vote
0 answers
31 views

Efficient chain rule implementation

(there is a fair amount of context here) I am implementing a generalized chain rule to do some work, say for order 3 in derivatives ($\partial_i = \partial/\partial x_i$): \begin{align} \partial_i \...
Felipe's user avatar
  • 499
1 vote
0 answers
83 views

How to efficiently calculate matrix operations when the elements are defined as functions?

I'm trying to calculate the one-body density matrix of a system of particles as described in this article, given in equations 14 and 15. Here, is my code but it seems very slow. Is there any efficient ...
sudipta's user avatar
  • 63
1 vote
0 answers
61 views

What is another way to write this equations in this list?

I have mylist: mylist = {{6, 7, 6, 2}, {7, 9, 7, 3}}; Here are two ways that I write equations from mylist: ...
Thuy Nguyen's user avatar
  • 1,097
1 vote
0 answers
64 views

Why is SequencePosition or SequenceCases so slow on large lists?

I observed that SequencePosition or Sequence Cases on a list of around 60'000 digits is so slow that I had to sort out to string pattern matching. Is this normal behavior or should Wolfram have a look ...
markilux's user avatar
  • 121
1 vote
0 answers
64 views

Export data vertically

I have data that I want to export to a text file. ...
Alyasaa Jasim's user avatar
1 vote
0 answers
67 views

What can be improved in the following custom interpolation?

Consider some test data: a grid of x, y, and values of some function on this grid: ...
John Taylor's user avatar
  • 5,827
1 vote
0 answers
56 views

Convert a graph to Lad format using a concise method

The LAD format is a kind of graph formats; see https://perso.liris.cnrs.fr/christine.solnon/SIP.html The specific format requirements are as follows: Each graph is described in a text file. If the ...
licheng's user avatar
  • 2,039
1 vote
0 answers
57 views

Selecting from a list of associations

From a list of Associations ...
eldo's user avatar
  • 75.2k
1 vote
0 answers
101 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
55 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
54 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,729
1 vote
0 answers
77 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
45 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
  • 71
1 vote
0 answers
53 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
70 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
58 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,418
1 vote
0 answers
51 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,960
1 vote
0 answers
63 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
  • 173
1 vote
0 answers
168 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
  • 567
1 vote
0 answers
174 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
217 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
0 answers
52 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
38 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
65 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
41 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
36 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,534
1 vote
0 answers
87 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,467
1 vote
0 answers
58 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
117 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
  • 5,827
1 vote
0 answers
89 views

How to define function Gradient of many variables?

I would like to define a function with a list as input variables and obtain gradient of this function. I have tried many different ways, the simplest one which works is as following example, ...
Yunlin Xu's user avatar
1 vote
0 answers
74 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
  • 71
1 vote
0 answers
100 views

Find invariant tensors under two matrix

I have two $9\times 9$ matrices $g_1, g_2$ where ...
Vayne's user avatar
  • 101
1 vote
0 answers
94 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
104 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
  • 645

1 2
3
4 5
11