wraplist

PlasmaCalcs.tools.arrays.wraplist(x, wraprow=None, wrapcol=None, *, fill=None, dtype=<class 'object'>)

wrap 1D list into a 2D array. Fill missing elements with fill.

Must provide wraprow or wrapcol, but not both:

wraprow: None or int
result rows will have this length. result goes left to right then top to bottom.
E.g. [1,2,3,4,5,6,7,8,9], wraprow=4 –> [[1,2,3,4], [5,6,7,8], [9,fill,fill,fill]]
wrapcol: None or int
result cols will have this length. result goes top to bottom then left to right.
E.g. [1,2,3,4,5,6,7,8,9], wrapcol=4 –> [[1,5,9], [2,6,fill], [3,7,fill], [4,8,fill]]
fill: None or any value
fill missing elements with this value.
dtype: any valid specifier for a numpy dtype
dtype for resulting numpy array.