Questions tagged [list-manipulation]
Questions on the manipulation of List objects in Mathematica, and the functions used for these manipulations.
9,779 questions
2
votes
1
answer
215
views
Converting a list of a function in Mathematica [closed]
Assume that I define:
...
2
votes
3
answers
227
views
In a nested, ragged list, pairing each element of one sublist with each element of another
This may be a silly question, and if it is, I'm willing to withdraw it. I have a list of lists myInitialList. I wish to write a function to transform ...
4
votes
1
answer
150
views
How to Simplify 'unordered' lists of expressions
Say I have a list containing some expressions, for instance
...
3
votes
1
answer
124
views
Why is Position with level spec {1} evaluating on {0}?
The title says it all. These two examples both have StringEndsQ emit an error message because it's being evaluated on the head of the input list.
...
5
votes
2
answers
282
views
What is the List analogue to StringSplit?
Suppose I have a string myString = "ABC DEF". To split myString into a list of separate strings delimited by ...
5
votes
4
answers
340
views
How to find all possible splits of a list into sublists sharing exactly one element?
Given a list, I want to find all possible ways to split it into sublists such that:
Each sublist has length greater than 1.
Any two consecutive sublists share exactly one common element.
All elements ...
7
votes
7
answers
368
views
Apply a function onto sublist and include an additional argument
I have myList, a list of triples:
myList = {
{a1, a2, a3},
{b1, b2, b3},
{c1, c2, c3}
};
I wish to apply a function ...
4
votes
3
answers
178
views
How to apply a list of binary operators to a list of arguments respecting standard operator precedence?
I have a list of binary functions such as {Plus, Times, Subtract} and a list of symbols like {a, b, c, d}. I want to construct ...
3
votes
2
answers
146
views
KroneckerProduct of vectors with different grouping
I have just encountered a weird problem for which I cannot understand the reason. Say I have two vectors that I define as
o = {0, 1};
z = {1, 0};
Now I am ...
10
votes
11
answers
507
views
Riffle a list of binary functions into list of arguments to produce a result
Suppose I have a list of binary functions, e.g.
funcs = {Plus, Times, Power}
as well as a list of arguments, e.g.
...
2
votes
0
answers
88
views
Is there any way to parallelize MapThread@AssociationThread?
Consider this code:
...
1
vote
3
answers
174
views
How do I get the rolling five-year averages for two values from a double nested list?
My data looks something like this:
...
2
votes
2
answers
140
views
How to extract specific strings in items inside a list?
I have data I want to plot comprised of values on time.
The data comes from a .log file imported as Table. Each line in this file is logged as
[2025.09.15-12.36.00:160][543]Log: 42
being [Date and ...
5
votes
1
answer
372
views
Every repetition of the same list manipulation takes longer
Consider a list:
list = RandomReal[{-15000, 20000}, {#, 2}] & /@
RandomInteger[{1950, 2100}, 16000];
And a simple function mapped over it:
...
3
votes
1
answer
296
views
Thread @ Join unexpected behavior
Consider this example from the Wolfram Documentation:
Thread[f[{a, b, c}, x]]
{f[a, x], f[b, x], f[c, x]}
Now, let's modify the list:
...