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
1 vote
0 answers
34 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 ...
b3m2a1's user avatar
  • 46.6k
1 vote
0 answers
43 views

Generation of nested list

Does anyone know a better way get the output generated by this code: Table[Table[{b-a,b},{b,7}]{a,7}]
hnh's user avatar
  • 165
1 vote
0 answers
61 views

Custom Table, for iterating over permutations

It is common that I iterate over all permutations of 1,2...,n, either by making a table or performing a sum. Instead of creating the set of all permutations, it would be better to iterate over them. ...
Per Alexandersson's user avatar
1 vote
0 answers
36 views

How can I create a ParallelTable with finer resolution at certain points?

For example, say I have a function testfunc already defined to take one argument $x$. This command would create a table of ...
Allure's user avatar
  • 625
1 vote
0 answers
44 views

How to confirm the list of plot unique

I have a list of plot in a list called modes. I am interested in knowing whether this list is unique or not, meaning all the plots are different from one another. ...
acoustics's user avatar
  • 1,699
1 vote
0 answers
40 views

Using the Line command with a bound on distance between points

Suppose I use the Line command applied to a list (or more accurately apply Graphics[Line[list]] or ...
math's user avatar
  • 713
1 vote
0 answers
58 views

Evaluate For Loop for a fixed number of iterations

a = Table[Prime[n], {n, PrimePi[i]}]; b = Delete[a, 1]; p = IntegerPartitions[i, 4, b]; Total[ Times @@ Values[1/Factorial@#] & /@ Counts /@ p]; I need to ...
user75105's user avatar
1 vote
0 answers
63 views

finding primes using chebyshev bias

Using the problem from my previous question link. For each n, that is n= $10^3$ to $10^6$ with a ten-fold increase, how do I use Chebyshev Bias to display the number of primes (which are in the ...
complab56's user avatar
1 vote
0 answers
55 views

putting condition on do loop

...
tabi_k's user avatar
  • 157
1 vote
0 answers
37 views

Solving a system of differential equations whose one of the coefficients is imported data

Suppose we have a coupled system of differential equations: \begin{equation} \frac{db}{dt}=(- \gamma_b -i\omega_b)b-i\frac{g}{2}p;\quad \frac{dp}{dt}=i\frac{g}{2}\Delta N(t) b-(\gamma_a+\gamma_b+2iJ)p....
Saeid 's user avatar
  • 751
1 vote
0 answers
59 views

Find parameter ranges of a function whose value is within a window by sampling points

Problem: I want to find the ranges of the parameters for a function $f(x,y,z)$ when $0.9 < f(x,y,z) < 1.1$. All parameters are bounded $x , y, z \in [0,1]$. In the real problem the function ...
anecdote's user avatar
  • 111
1 vote
0 answers
76 views

Problems with using Riffle, Grid and TableForm

I have the following Table: ...
Richard Burke-Ward's user avatar
1 vote
0 answers
68 views

Importing multiple files setting the name with tostring

I'm trying to import several matrices, which contain a pattern in the name. I create first their names in a table ...
peter's user avatar
  • 41
1 vote
0 answers
53 views

Closest number between two lists within a given tolerance

If I have two large list with numbers such as: list1={number1,number2,number3..........etc} list2={number1,number2,number3..........etc} Question: How can I find ...
John's user avatar
  • 1,581
1 vote
0 answers
61 views

Apply DateObject to a whole list

I'm trying to apply DataObject to a whole list. It looks something like this. ...
iLixer's user avatar
  • 11
1 vote
0 answers
37 views

Generating a list of the degree-$n$ Kronecker polynomials

A Kronecker polynomial is a polynomial such that Its coefficients are integers, Its roots are on the unit circle or $0$, Its leading coefficient is $1$. From here, there are finitely many Kronecker ...
Descartes Before the Horse's user avatar
1 vote
0 answers
94 views

List of arrays in Mathematica

How would I declare a list of arrays and treat them as single objects? For example, I may have the Pauli matrices: $$ \sigma_0 = \begin{bmatrix}1 & 0 \\ 0 & 1\end{bmatrix}, \sigma_1 = \begin{...
QuestionEverything's user avatar
1 vote
0 answers
36 views

Using Select for lattice points

I know how to use Select to generate a list of numbers which satisfy a certain condition. However, I am not sure how to do this for points (specifically 2-tuples) ...
Descartes Before the Horse's user avatar
1 vote
0 answers
61 views

Finding the domain in which a function is analytic with no imaginary part

I was wondering if it is easy to see if a given expression evaluates to a real number in a given domain? Let e.g. f(x,y,z) be some function depending on three ...
CAF's user avatar
  • 510
1 vote
0 answers
363 views

Thread::tdlen: Objects of unequal length in {{a,b,e},{c,d,f}} {x,y,z} cannot be combined

When I do the Times operation among list like this {{a, b, e}, {c, d, f}}*{x, y, z}, the error message is given as Thread::tdlen: Objects of unequal length in ...
so_sure's user avatar
  • 309
1 vote
0 answers
68 views

Making Table with nested SetDelay functions is very slow

I am trying to write a function which returns a list of lists of eigenenergies available for a quantum well. The code is here: ...
Jacob Fast's user avatar
1 vote
0 answers
44 views

Very large list with sublists of varying dimension

I have a very large list of events,Evin, grouped into sublists. All these sublists have 15 elements each and the large list has about 1 - 2 million of these sublists. I now want to regroup that large ...
user3584513's user avatar
1 vote
0 answers
57 views

How can I convert the Defer result to a String

I have created a package.wl where I am building a simple interface with input fields and buttons to generate and solve some simple integer logarithms. There is a button [show solution] that explains ...
e1c's user avatar
  • 11
1 vote
0 answers
60 views

How to define more general boundary conditions for ConvolutionLayer?

In Mathematica 12, I only see the option to define "PaddingSize" for a ConvolutionLayer in order to get Dirichlet boundary ...
Fidel I. Schaposnik's user avatar
1 vote
0 answers
42 views

Remove braces from AppendTo output

If I have the following inside a loop: tts={}; AppendTo[tts, p] where p is just a number at each iteration so that in the first iteration I get: ...
John's user avatar
  • 1,581
1 vote
0 answers
82 views

LeviCivitaTensor contraction indices

My computer has problems when I try to perform a calculation with TensorContract. In particular, with the second answer to my previous question Contracting indices ...
FB20's user avatar
  • 73
1 vote
0 answers
53 views

ListPoinPlot3D works but ListPlot3D does not

I don't understand what is going on. The same table, plotted with the tool ListPointPlot3D gives the desired output. But plotted with ...
Daniel G. Suárez Forero's user avatar
1 vote
0 answers
95 views

Faster methods for performing repeated list manipulations?

I've done my best to pore over the other posts on this site, and to the best of my ability I can't seem to find a good solution to my problem, so I apologize in advance if elements of my question are ...
Texas Red's user avatar
  • 301
1 vote
0 answers
102 views

Loop over variable sized arrays

I would like to build an Encoder/Decoder to export my Data from Mathematica to Julia. From Mathematica I get arrays of variable dimensions, these arrays contain variables that don't have a fixed value ...
Hamilcar's user avatar
  • 133
1 vote
0 answers
152 views

How to delete random elements with RandomChoice?

I have a list of prices and a list of dates, but I have 154 more prices than dates. So I want to delete random prices to match both lists, however, every time I run the block of code I get a different ...
trashparticle's user avatar
1 vote
0 answers
44 views

Apply SequenceReplace with a fixed shift

How can I apply SequenceReplace with a fixed prespecified shift instead of a shift equal to the length of the pattern, on a given list? E.g. ...
Al Guy's user avatar
  • 1,580
1 vote
0 answers
37 views

MapAT and GeoPosition

I just experienced a problem applying GeopPosition via MapAt. Here a MWE. Given a list of data: ...
mgamer's user avatar
  • 5,573
1 vote
0 answers
50 views

Loss layer for vectors with component mixing or non-trainable number array in NN layer

Suppose we need to construct an unconventional loss function for my neural network: vector MSE but taking into account the "similarity" of variables. My network takes data vectors ($m=40$ D) and ...
Druid's user avatar
  • 395
1 vote
0 answers
28 views

Distribute function - Limiting Possibilities

I have a very large list of lists of which I am applying the Distribute function to. Because of this, there are more than 10^9 combinations and my computer cannot handle that. I was wondering if it ...
Thomas Moore's user avatar
1 vote
0 answers
44 views

Coordinate transformation of a table of multi-variable function values

I've created a table in Mathematica for a function dependent on r and phi of the form ...
Franz's user avatar
  • 21
1 vote
0 answers
98 views

Measuring Degree Correlations of Networks

I'm trying to write a program that will measure the degree correlation of the network. The theory is here (page 8). I've written something like this up to now: ...
ralph's user avatar
  • 1,019
1 vote
0 answers
186 views

How to compute the multiplicative order of an element in a finite field

I want to find the multiplicative order of say the element {0,1,0} in GF[8]. I made a list: b = Map[GF[8][#] &, Tuples[{0, 1}, 3]] I tried: NestWhileList[b[[3]]*# &, b[[3]], # != b[[5]] &...
geoffrey's user avatar
  • 795
1 vote
0 answers
73 views

How to assign a nested list indices for later use

In an attempt to calculate a summation dependent upon a nested list it appears that a simple use of [[{n,k}]] does not yield the desired result. For example with ...
Leucippus's user avatar
  • 365
1 vote
0 answers
85 views

Correctly Evaluating the existence of Large Solutions

I'm trying to correctly evaluate $$D(S\cap[a,b])=\lim_{n\to\infty}\frac{\left|S\cap{F_n\cap[a,b]}\right|}{\left|F_n\cap[a,b]\right|}$$ where $D$ is the density of $S\cap[a,b]$ (in $A\cap[a,b]$), $[...
Arbuja's user avatar
  • 39
1 vote
0 answers
39 views

Replacing factors that are only dependent on a single specific variable

I have expressions with terms that are products of factors. Some of the factors are expressions that depend on a single specific variable. I would like to replace those factors with constants and ...
Marijnn's user avatar
  • 287
1 vote
0 answers
76 views

Problems with the parametric Recurrence Table

I am trying to construct a minimization program where I have to minimize a function with respect to a matrix. This matrix enters into the optimization program in a convoluted manner together with data....
Kass's user avatar
  • 661
1 vote
0 answers
29 views

Solve, store, and access eigenvalues and eigenstates of M[x,y], for various points {x,y}

I'm interested in solving a position dependent eigenvalue problem for matrix M[x,y], where {x,y} is some discretized set of points. I may need to access the eigenstates and eigenvalues multiple times ...
Paul Eugenio's user avatar
1 vote
0 answers
245 views

Visualizing a huge weighted graph

Consider a weighted graph 'net': ...
ralph's user avatar
  • 1,019
1 vote
0 answers
117 views

Transform the data, and fitting it with a Lambert function

I got a list of numbers $x$: ...
J.A's user avatar
  • 1,245
1 vote
0 answers
232 views

Monitoring the Training Progress through PutAppend

I would like to export the round loss during my model training for each training round. Currently, I am using the way shown in the Documentation Center around TrainingProgressFunction and PutAppend: <...
demm's user avatar
  • 1,523
1 vote
0 answers
123 views

Understanding Maps and slot

Going through some old code I found this line: ...
Alex Long's user avatar
1 vote
0 answers
65 views

Mapping over array/matrix the efficient(compact) way

Update In short, I have myCAans[[1 ;; 5]] like this: {{0, 0, 0, True, 0, 0, 0, 0, True, 0, "T0", 39}, {0, 0, 0, True, 0, 0, 0, 1, True, 1, "B", 101500}, {...
Chen Stats Yu's user avatar
1 vote
0 answers
58 views

Inserting a table data inside the function

Consider a table with n columns and function f[x] depending on n coordinates, $x = x_{1},...,x_{n}$. I want to interpret the table as a set of points in n-dimensional space and calculate the function ...
John Taylor's user avatar
  • 4,642
1 vote
0 answers
61 views

Reconstructing a partition from its character

Given a solid partition $\rho=\{\pi_1, \pi_2, ..\}$, where $\pi_a$ are plane partitions such that $\pi_{a+1} \subset \pi_a$, we can compute its character, which is a sum of monomials with non-negative ...
jj_p's user avatar
  • 210
1 vote
0 answers
457 views

ParametricPlot - Several curves by different parameters

I am trying to plot a set of curves f(a,b,t) along t with a,b = -10, -9, ..., 9, 10. I can use Manipulate to draw 1 curve, and then change the curve shape by ...
H42's user avatar
  • 3,439

1 2 3
4
5
11