Questions tagged [list-manipulation]
Questions on the manipulation of List objects in Mathematica, and the functions used for these manipulations.
9,781 questions
2
votes
1
answer
37
views
How to find a matrix in a ragged list?
I have been trying to efficiently process data scraped from websites. One issue is that the data I want is often in the form of a matrix embedded at some level in a ragged list. I have developed one ...
3
votes
1
answer
54
views
I can not reproduce returning the property of selected elements by Select[]
According to the documentation,
Select[data,crit->prop]
should return the property prop of the selected elements.
When I run
...
2
votes
1
answer
222
views
Converting a list of a function in Mathematica [closed]
Assume that I define:
...
3
votes
3
answers
238
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
152
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
284
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
179
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
508
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
89
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
141
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 ...