Currently I have something that looks like this:
if width < 101:
column_placement_0[index] = rectangles
elif width < 201:
column_placement_1[index] = rectangles
elif width < 301:
column_placement_2[index] = rectangles
... and so on.
Instead, I want to be able to just initialize a single columns array which stores dictionaries.
First, I feel that I would initialize an array normally...
columns = []
but then I don't know how I would reference the individual list and dictionary indices maybe something like a 2D array in Java?
columns[index][dict_key] = value
What do I do?
column_placement_0and etc... with the singlecolumnlist? It appears that 100 possible widths could go into a singlecolumn_placement_X... except it has someindexthing that has me puzzled. If two rectangles end up in the same index (is that even possible?) should one overwrite the other? If you wrote a demo script that shows what you are doing it would help. Your fragments and description leave a lot to interpretation.columns = [None] * 1000.