Linked Questions

564
votes
19answers
143k views

Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
182
votes
20answers
14k views

What are some useful, undocumented Mathematica functions?

There have already been some questions about some undocumented functionality in Mathematica. Such as (please add to these lists!) How can one find undocumented options or option values in Mathematica?...
23
votes
9answers
1k views

UnFlatten an array into a ragged matrix

Trying to unflatten an array that was part of ragged array of sub matrices. As input we have flattened array: ...
18
votes
4answers
1k views

“Indexing” a vector

I need to "index" a vector according to the first occurence of its distinct elements. I have written ...
14
votes
5answers
774 views

Smarter Shuffle of a List

I have a 2D matrix representing a keyboard: ...
11
votes
7answers
554 views

Adding list of list to a list

Hello I need some help on how to add a list to a list of list. The program would have to do as below: {{0,0}, {0}, {0,0,0}}+{1,2,3,4,5,6} will give ...
8
votes
3answers
1k views

How to fix this memory leak

I am using halirutan's code in this thread to unflatten a list. It works very well but the problem is that the Module's local function f is not deleted when the ...
4
votes
4answers
412 views

How to reshape a list as another ragged list [duplicate]

Background If I want wo reshape list1 as list2: ...
5
votes
2answers
466 views

Provided an array of 2D point clouds, can we quickly replace distance- and index-based cliques of points with their median or mean values?

Imagine I have $N \approx 10^5$ clouds of points in an array of the form: UPDATED ...
7
votes
3answers
558 views

Map structure of irregular list, Flatten then reconstruct list using structure

I'm trying to use Compile[] to improve the performance of an algorithm. The algorithm works on a set of matrices which are not of a similar shape. Unfortunately ...