Linked Questions

3 votes
1 answer
492 views

This is a conscious duplicate of On generalizing Partition[] (with offsets) to sublists of unequal length: it was seven years ago, and all answers are quite involved; maybe something easier has been ...
მამუკა ჯიბლაძე's user avatar
3 votes
0 answers
754 views

I have the list {7, 8, 9, 10, 11, 12, 13, 14} and would like to split it into a list of size 2, a list of size 3, and covert the remaining element into singleton ...
user41106's user avatar
3 votes
1 answer
96 views

Let's say I have a set of numbers "r" whose sum equals 15, and I want to randomize all values up to and including that sum from and including 1 into a set called "a". So far I have this: ...
Travis Arlen McCracken's user avatar
608 votes
19 answers
161k views

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 ...
79 votes
9 answers
13k views

Is there an efficient way to find the positions of the duplicates in a list? I would like the positions grouped according to duplicated elements. For instance, given ...
Michael E2's user avatar
  • 261k
125 votes
3 answers
10k views

A simple sounding question with a few sub questions: What is the difference between unpacked vs packed array? Are packed arrays more space efficent, how much so? Are packed arrays more time efficient ...
nixeagle's user avatar
  • 2,303
46 votes
10 answers
7k views

I'm looking for a function that finds the index of the zero-crossing points of a list. Before I go making my own subroutine to do this, I was wondering if anyone knows of any built-in Mathematica ...
dthor's user avatar
  • 1,011
22 votes
12 answers
1k views

Given lst = {a, b, c, d} I'd like to generate {{a}, {a, b}, {a, b, c}, {a, b, c, d}} but using built-in functions only, ...
Nasser's user avatar
  • 157k
44 votes
6 answers
4k views

Context I'm writing a function that look something like: ...
user avatar
23 votes
10 answers
2k views

Trying to unflatten an array that was part of ragged array of sub matrices. As input we have flattened array: ...
lalmei's user avatar
  • 3,362
15 votes
6 answers
2k views

Consider a list, AK6, that has 382 sublists of length varying from 2500 to 3000. Each "subsublist" is as such : ...
500's user avatar
  • 5,629
23 votes
6 answers
1k views

This question is hard to describe in plain text. So I will post an example and a working code (brute force) to illustrate. For example I have a list: ...
vapor's user avatar
  • 7,946
13 votes
11 answers
796 views

Say, we have a list: m1 = {2, 2, 7, 0, 7, 7, 2, 2, 2} It can be split easily: ...
garej's user avatar
  • 5,017
16 votes
8 answers
3k views

What is the best way to populate an upper triangular (or alternatively: lower triangular or symmetric) matrix from a vector of elements? This example input: ...
Szabolcs's user avatar
  • 239k
10 votes
6 answers
3k views

Every time I want to manually input a matrix in Mathematica, it takes me a while since every new row has to be in a separate pair of curly braces. For instance: ...
henry's user avatar
  • 2,560

15 30 50 per page