How to convert a known one-dimensional array into a two-dimensional array by python but without using numpy? (just using basic python language)) e.g suppose you have an one dimensional array with 100 elements, now you need to use python to transfer it into a 10x10 matrix but without using numpy. You can only use the basic python language, like for loops.
Asked
Active
Viewed 15 times
0
-
Basic Python doesn't have arrays, do you mean a list? – Barmar Mar 12 '20 at 11:57
-
yes. It is a list. – 唐浩文 Mar 12 '20 at 11:59
-
@Barmar well, it does, for primitive numeric types, `import array; array.array('b',[1,2,3])`, but that doesn't support multidimensional arrays, like `numpy`. The OP *probably means nested lists* – juanpa.arrivillaga Mar 12 '20 at 12:00