{"id":1033,"date":"2017-01-22T12:30:31","date_gmt":"2017-01-22T18:30:31","guid":{"rendered":"http:\/\/blog.ls-al.com\/?p=1033"},"modified":"2017-01-22T12:30:31","modified_gmt":"2017-01-22T18:30:31","slug":"python-dict-for-arrays","status":"publish","type":"post","link":"https:\/\/blog.ls-al.com\/python-dict-for-arrays\/","title":{"rendered":"Python Dict for Arrays"},"content":{"rendered":"
Some more examples of Python dicts and array general use.<\/p>\n
\r\nimport pprint\r\n\r\n### Example python dict as an associative multi array\r\n### Example is using an unique key\r\npp = pprint.PrettyPrinter(indent=2)\r\n\r\ntable = {}\r\ntable[1]={'LastName':'Sable','name':'Sam'}\r\ntable[2]={'LastName':'Sable','name':'Samantha'}\r\ntable[3]={'LastName':'Sable','name':'Stevie'}\r\n\r\npp.pprint(table)\r\n\r\nprint table[2]\r\nprint table[3]['name']\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"Some more examples of Python dicts and array general use. import pprint ### Example python dict as an associative multi<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-1033","post","type-post","status-publish","format-standard","hentry","category-python"],"_links":{"self":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/1033","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/comments?post=1033"}],"version-history":[{"count":0,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/1033\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/media?parent=1033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/categories?post=1033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/tags?post=1033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}