I’ trying to create a PHP like array in python. In Perl it would be a hash…
I want to organize content from the database in an array for easier access.
Something like:
myarray[db_numeric_value1][db_numeric_value2] = db_str_value
But no luck so far…
I tried to initialize myarray as an object list (myarray = {}) or as an array (myarray = [])… Also tried to initialize the “subarrays” but did not work either…
Thanks for your help!
Ron
you may use python’s defaultdict with proper “default_factory”: