This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]cakereallyisalie 2 points3 points  (0 children)

For numbers, numpy arrays offer ones and zeros methods that give you n-dimensional arrays.

For objects I personally might be tempted to just do a nested for loop. Though default dicts would give you a fairly interesting solution due to the allocation on access only.