New answers tagged

1

ArrayReshape seems quite clean to my eye, even with replacement for null padding. It also works in v9.0 and after, whereas UpTo was introduced in v10.3. Module[{x}, splitIn[p_Integer?Positive][a_?ListQ] := ArrayReshape[a, {p, ⌈Length@a/p⌉}, x] /. x -> Sequence[] ]


1

This seems to do the job: spl[lst_, n_] := TakeList[lst, Subdivide[1, Length@lst, n] // Round // Differences];


Top 50 recent answers are included