Skip to main content

All Questions

Filter by
Sorted by
Tagged with
5 votes
6 answers
699 views

How to efficiently select elements with the minimum value from a large list?

How can I efficiently select sublists with the minimum value of the third elmement from the following list? ...
2 votes
2 answers
81 views

Best way to extend the size and add terms to a SparseArray without expanding

Let's say I have a "small" SparseArray of any size, in the example $2\times2$ ...
10 votes
6 answers
442 views

Replacing consecutive empty sublists with their run-lengths

I have a list like this: ...
7 votes
4 answers
551 views

Optimal Solution for OddsBeforeEvens Wolfram Challenge

Odds before Evens Given a list of integers, rearrange them so that all of the odd integers appear before all of the even integers, without otherwise changing the order. An obvious solution is ...
7 votes
4 answers
525 views

Fill an empty matrix with the depth of its elements

Given an arbitrarily nested empty matrix like for example mat = { {}, {{}, {}}, {{}, {{}}, {}}, {{}, {{}}, {}, {{{}}}} }; and knowing that ...
12 votes
10 answers
1k views

Elegant way to map a function to only the last element of each sublist [duplicate]

Suppose that I have the following list, called test: test = {{{a1}, {a2, a3}}, {{b1}, {b2, b3}}, {{c1}, {c2, c3}}}; Now ...