Skip to main content
deleted 26 characters in body
Source Link
vapor
  • 7.9k
  • 2
  • 23
  • 56

I tried to be consistent with your functionA simpler version.

p[list_, n_] := 
 Module[{res = Partition[list, UpTo[Ceiling[Length[list]/n]]]}, 
  Join[res, Table[{}, n - Length[res]]]]

I tried to be consistent with your function.

p[list_, n_] := 
 Module[{res = Partition[list, UpTo[Ceiling[Length[list]/n]]]}, 
  Join[res, Table[{}, n - Length[res]]]]

A simpler version.

p[list_, n_] := 
 Module[{res = Partition[list, UpTo[Ceiling[Length[list]/n]]]}, 
  Join[res, Table[{}, n - Length[res]]]]
Post Undeleted by vapor
Post Deleted by vapor
Source Link
vapor
  • 7.9k
  • 2
  • 23
  • 56

I tried to be consistent with your function.

p[list_, n_] := 
 Module[{res = Partition[list, UpTo[Ceiling[Length[list]/n]]]}, 
  Join[res, Table[{}, n - Length[res]]]]