{"id":3329,"date":"2020-06-23T17:06:55","date_gmt":"2020-06-23T11:36:55","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=3329"},"modified":"2024-01-01T12:22:11","modified_gmt":"2024-01-01T06:52:11","slug":"python-hashmaps","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/python-hashmaps\/","title":{"rendered":"Python Hashmaps | Implementing using Dictionary"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Every second of every day, our senses bring in way too much data than we can possibly process in our brains<\/p>\n<cite>\u2013 Peter Diamandis Chairman\/CEO of, X-Prize Foundation.<\/cite><\/blockquote>\n\n\n\n<p>This quote is enough to show the importance of data in today&#8217;s world. Not only is massive data being produced every second, but it also has a lot of variety.<\/p>\n\n\n\n<p>We need different types of data structures to store this variety of data. Some data needs to be stored sequentially, while some data needs to be stored in <strong>key-value pairs<\/strong>. In this article, we will learn how to store data with the help of Python hashmaps.<\/p>\n\n\n\n<p><strong>Python hashmaps are a type of data structure that stores data in the form of a key-value pair. The primary purpose of the Python hashmaps is to retrieve data with the help of the key. Hashmaps are also termed Dictionaries in Python.<\/strong><\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #990303;color:#990303\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #990303;color:#990303\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.pythonpool.com\/python-hashmaps\/#The_intuition_behind_Python_hashmaps\" >The intuition behind Python hashmaps<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.pythonpool.com\/python-hashmaps\/#Implementation_of_Python_HashMaps\" >Implementation of Python HashMaps<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.pythonpool.com\/python-hashmaps\/#Editing_and_Removing_Value_Python_Hashmaps\" >Editing and Removing Value: Python Hashmaps<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pythonpool.com\/python-hashmaps\/#Difference_Between_HashMaps_and_HashTable_in_Python\" >Difference Between HashMaps and HashTable in Python<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pythonpool.com\/python-hashmaps\/#Must_Read\" >Must Read:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pythonpool.com\/python-hashmaps\/#Conclusion\" >Conclusion-<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-the-intuition-behind-python-hashmaps\"><span class=\"ez-toc-section\" id=\"The_intuition_behind_Python_hashmaps\"><\/span>The intuition behind Python hashmaps<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In hashmaps, the key is generated through hash functions. The main characteristics of this key are that it is<strong> unique and cannot be null (nothing)<\/strong>. Also, hashmaps are non-synchronized. If we use it in a multithread environment, then more than one thread can access it and use the HashMap simultaneously.<\/p>\n\n\n\n<p>It is not like we cannot use the index to retrieve values in a list or array, but the advantage of hashmaps is that we can make key strings, too. These types of keys are easy to remember, thus making retrieval easy and fast. Updating and deleting values also become easy.<\/p>\n\n\n\n<p>In a programming language like Java, hashmaps are implemented using the collection framework. But in Python, hashmaps are implemented using the built-in data type &#8211; dictionary.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-implementation-of-python-hashmaps\"><span class=\"ez-toc-section\" id=\"Implementation_of_Python_HashMaps\"><\/span>Implementation of Python HashMaps<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In Python, dictionaries satisfy all the requirements, like unique keys and non-null values. Let us learn how to create hashmaps using some real-life examples.<\/p>\n\n\n\n<p>When we need to make a call, we generally search for the name of the person, and as an output, we get the desired phone number. That is an example of hashmaps. The name is the key, and the phone number is the value. Now, suppose you have a list of phone numbers. And you want to make a phone call to a certain someone. How easy is the retrieval of that number from the list? Very difficult, I guess.<\/p>\n\n\n\n<p>Also, it is challenging to remember phone numbers. Because as humans, we are not good at remembering numbers, but we are great at remembering names. Take another situation where you want to delete that phone number. If you know the name, you can easily remove the number. Now, that was a lot of explanation. Let&#8217;s begin the implementation.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nphone_numbers={\n'person1':909090909,\n'person2':808080808,\n'person3':707070707,\n'person4':606060606,\n'person5':505050505,\n'person6':909090901,\n'person7':808080802,\n'person8':707070703,\n'person9':606060604,\n'person10':505050500\n}\n\nprint(phone_numbers)\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1586\" height=\"820\" src=\"https:\/\/i0.wp.com\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/image-52.png?fit=1024%2C529&amp;ssl=1\" alt=\"python hashmaps\" class=\"wp-image-3330\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/image-52.png 1586w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/image-52-300x155.png 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/image-52-1024x529.png 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/image-52-768x397.png 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/image-52-1536x794.png 1536w\" sizes=\"(max-width: 1586px) 100vw, 1586px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\">Output-\n{'person1': 909090909, 'person2': 808080808, 'person3': 707070707, 'person4': 606060606, 'person5': 505050505, 'person6': 909090901, 'person7': 808080802, 'person8': 707070703, 'person9': 606060604, 'person10': 505050500}<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If we want to search for a phone number of person1-<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nphone_numbers={\n'person1':909090909,\n'person2':808080808,\n'person3':707070707,\n'person4':606060606,\n'person5':505050505,\n'person6':909090901,\n'person7':808080802,\n'person8':707070703,\n'person9':606060604,\n'person10':505050500\n}\nprint(phone_numbers.get('person1'))\n# or print(phone_numbers&#x5B;'person1'])\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1586\" height=\"820\" src=\"https:\/\/i1.wp.com\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/image-53.png?fit=1024%2C529&amp;ssl=1\" alt=\"python hashmaps\" class=\"wp-image-3331\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/image-53.png 1586w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/image-53-300x155.png 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/image-53-1024x529.png 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/image-53-768x397.png 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/image-53-1536x794.png 1536w\" sizes=\"(max-width: 1586px) 100vw, 1586px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\">Output-\n909090909<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-editing-and-removing-value-python-hashmaps\"><span class=\"ez-toc-section\" id=\"Editing_and_Removing_Value_Python_Hashmaps\"><\/span>Editing and Removing Value: Python Hashmaps<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Now, let&#8217;s suppose you want to remove\/delete this value.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nphone_numbers.pop('person1')\nprint(phone_numbers)\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-\n{'person2': 808080808,\n'person3': 707070707,\n'person4': 606060606,\n'person5': 505050505,\n'person6': 909090901,\n'person7': 808080802,\n'person8': 707070703,\n'person9': 606060604,\n'person10': 505050500}<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You can also update the phone number if that person has changed the phone number.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nphone_numbers&#x5B;'person3']=333333333\nprint(phone_numbers)\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-\n{'person2': 808080808,\n'person3': 333333333,\n'person4': 606060606,\n'person5': 505050505,\n'person6': 909090901,\n'person7': 808080802,\n'person8': 707070703,\n'person9': 606060604,\n'person10': 505050500}<\/pre>\n\n\n\n<p>Another way of updating the value is by using the update().<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nphone_numbers.update({'person4':111111111})\nprint(phone_numbers)\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-\n\n{'person2': 808080808,\n'person3': 333333333,\n'person4': 111111111,\n'person5': 505050505,\n'person6': 909090901,\n'person7': 808080802,\n'person8': 707070703,\n'person9': 606060604,\n'person10': 505050500}<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Adding values-<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nphone_numbers&#x5B;'person11']=111111111\nprint(phone_numbers)\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">Output-\n{'person2': 808080808, 'person3': 333333333, 'person4': 111111111, 'person5': 505050505, 'person6': 909090901, 'person7': 808080802, 'person8': 707070703, 'person9': 606060604, 'person10': 505050500, 'person11': 111111111}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-difference-between-hashmaps-and-hashtable-in-python\"><span class=\"ez-toc-section\" id=\"Difference_Between_HashMaps_and_HashTable_in_Python\"><\/span>Difference Between HashMaps and HashTable in Python<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In Python, there is not much of a difference between <strong>Python<\/strong> <strong>hashmaps, hashtables<\/strong>, and dictionaries. But in other languages, one of the most common interview questions in hashmaps is it&#8217;s explaining its difference with hashtables. <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>One of the crucial differences between hashtables and hashmaps is that hashtables are synchronized, but hashmaps are not. We already know the meaning of non-synchronized, and now let us see what synchronized data structure is. <strong>It means<\/strong> that\u00a0only one thread can be modified by a\u00a0<strong>hashtable<\/strong>\u00a0at one point in time.<\/li>\n\n\n\n<li>HashMaps are faster and take much less <a href=\"https:\/\/en.wikipedia.org\/wiki\/Memory\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"yoast-seo-link\">memory<\/a> when compared to HashTables.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-red-color has-text-color\" id=\"h-must-read\"><span class=\"ez-toc-section\" id=\"Must_Read\"><\/span>Must Read:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"http:\/\/www.pythonpool.com\/python-lowercase\/\">How to Convert String to Lowercase in<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/www.pythonpool.com\/square-root-in-python\/\">How to Calculate Square Root<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/www.pythonpool.com\/python-user-input\/\">User Input | Input () Function | Keyboard Input<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/www.pythonpool.com\/python-book\/\">Best Book to Learn Python<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion-<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Python Hashmaps are significant data structures when we have data in the form of a key-value pair. The implementation of hashmaps in Python is straightforward if we compare it to other languages because in Python, we have dictionaries to make the task easier.<\/p>\n\n\n\n<p>Try to run the programs on your side, and let me know if you have any queries.<\/p>\n\n\n\n<p><strong>Happy Coding!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Every second of every day, our senses bring in way too much data than we can possibly process in our brains \u2013 Peter Diamandis Chairman\/CEO &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Python Hashmaps | Implementing using Dictionary\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/python-hashmaps\/#more-3329\" aria-label=\"More on Python Hashmaps | Implementing using Dictionary\">Read more<\/a><\/p>\n","protected":false},"author":3,"featured_media":3335,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[15],"tags":[1128,1145,1133,1141,1137,1124,1125,1127,1132,1120,1139,1126,1138,1144,1136,1121,1131,1130,1135,1122,1134,1123,1129,1140,1143],"class_list":["post-3329","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-create-hashmap-in-python","tag-create-hashmap-python","tag-custom-sorting-dictionary-python-pass-hashmap","tag-difference-between-dictionary-and-hashmap-python","tag-hashmap-equivalent-in-python","tag-hashmap-implementation-python","tag-hashmap-in-python","tag-hashmap-in-python-geeksforgeeks","tag-hashmap-put-in-python","tag-hashmap-python","tag-hashmap-python-implementation","tag-hashmap-vs-dictionary-python","tag-hashmap-with-multiple-keys-python","tag-implement-a-hashmap-in-python","tag-implement-hashmap-in-python","tag-python-dictionary-vs-hashmap","tag-python-hashmap","tag-python-hashmap-contains","tag-python-hashmap-example","tag-python-hashmap-implementation","tag-python-hashmap-keys-to-array","tag-python-hashmap-list","tag-python-hashmap-remove","tag-python-hashmap-vs-dictionary","tag-sort-hashmap-by-value-python","infinite-scroll-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.1 (Yoast SEO v25.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python Hashmaps | Implementing using Dictionary - Python Pool<\/title>\n<meta name=\"description\" content=\"python hashmaps stores data in the form of key-value pair. It is generally used for easy and fast retrieval. Hashmaps data can be retrieved with key.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pythonpool.com\/python-hashmaps\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Hashmaps | Implementing using Dictionary\" \/>\n<meta property=\"og:description\" content=\"Every second of every day, our senses bring in way too much data than we can possibly process in our brains \u2013 Peter Diamandis Chairman\/CEO of, X-Prize\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/python-hashmaps\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-23T11:36:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-01T06:52:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/Capture-6.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"605\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ashwini Mandani\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:site\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ashwini Mandani\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pythonpool.com\/python-hashmaps\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-hashmaps\/\"},\"author\":{\"name\":\"Ashwini Mandani\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/8a75fb48eb1f3dc952df65a8c28ac056\"},\"headline\":\"Python Hashmaps | Implementing using Dictionary\",\"datePublished\":\"2020-06-23T11:36:55+00:00\",\"dateModified\":\"2024-01-01T06:52:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-hashmaps\/\"},\"wordCount\":699,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-hashmaps\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/Capture-6.jpg\",\"keywords\":[\"create hashmap in python\",\"create hashmap python\",\"custom sorting dictionary python pass hashmap\",\"difference between dictionary and hashmap python\",\"hashmap equivalent in python\",\"hashmap implementation python\",\"hashmap in python\",\"hashmap in python geeksforgeeks\",\"hashmap put in python\",\"hashmap python\",\"hashmap python implementation\",\"hashmap vs dictionary python\",\"hashmap with multiple keys python\",\"implement a hashmap in python\",\"implement hashmap in python\",\"python dictionary vs hashmap\",\"python hashmap\",\"python hashmap contains\",\"python hashmap example\",\"python hashmap implementation\",\"python hashmap keys to array\",\"python hashmap list\",\"python hashmap remove\",\"python hashmap vs dictionary\",\"sort hashmap by value python\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com\/python-hashmaps\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pythonpool.com\/python-hashmaps\/\",\"url\":\"https:\/\/www.pythonpool.com\/python-hashmaps\/\",\"name\":\"Python Hashmaps | Implementing using Dictionary - Python Pool\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-hashmaps\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-hashmaps\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/Capture-6.jpg\",\"datePublished\":\"2020-06-23T11:36:55+00:00\",\"dateModified\":\"2024-01-01T06:52:11+00:00\",\"description\":\"python hashmaps stores data in the form of key-value pair. It is generally used for easy and fast retrieval. Hashmaps data can be retrieved with key.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-hashmaps\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com\/python-hashmaps\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/python-hashmaps\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/Capture-6.jpg\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/Capture-6.jpg\",\"width\":1000,\"height\":605,\"caption\":\"python hashmaps\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com\/python-hashmaps\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Hashmaps | Implementing using Dictionary\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pythonpool.com\/#website\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"name\":\"Python Pool\",\"description\":\"Your One-Stop Python Learning Destination\",\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pythonpool.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pythonpool.com\/#organization\",\"name\":\"Python Pool\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"contentUrl\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"width\":452,\"height\":185,\"caption\":\"Python Pool\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/pythonpool\",\"https:\/\/www.youtube.com\/c\/pythonpool\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/8a75fb48eb1f3dc952df65a8c28ac056\",\"name\":\"Ashwini Mandani\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f765ed1940ac0ae1d30ce4cb2f1452c1e83143b07354d25a42c1cd118980e269?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f765ed1940ac0ae1d30ce4cb2f1452c1e83143b07354d25a42c1cd118980e269?s=96&d=wavatar&r=g\",\"caption\":\"Ashwini Mandani\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python Hashmaps | Implementing using Dictionary - Python Pool","description":"python hashmaps stores data in the form of key-value pair. It is generally used for easy and fast retrieval. Hashmaps data can be retrieved with key.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pythonpool.com\/python-hashmaps\/","og_locale":"en_US","og_type":"article","og_title":"Python Hashmaps | Implementing using Dictionary","og_description":"Every second of every day, our senses bring in way too much data than we can possibly process in our brains \u2013 Peter Diamandis Chairman\/CEO of, X-Prize","og_url":"https:\/\/www.pythonpool.com\/python-hashmaps\/","og_site_name":"Python Pool","article_published_time":"2020-06-23T11:36:55+00:00","article_modified_time":"2024-01-01T06:52:11+00:00","og_image":[{"width":1000,"height":605,"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/Capture-6.jpg","type":"image\/jpeg"}],"author":"Ashwini Mandani","twitter_card":"summary_large_image","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Ashwini Mandani","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/python-hashmaps\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/python-hashmaps\/"},"author":{"name":"Ashwini Mandani","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/8a75fb48eb1f3dc952df65a8c28ac056"},"headline":"Python Hashmaps | Implementing using Dictionary","datePublished":"2020-06-23T11:36:55+00:00","dateModified":"2024-01-01T06:52:11+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/python-hashmaps\/"},"wordCount":699,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/python-hashmaps\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/Capture-6.jpg","keywords":["create hashmap in python","create hashmap python","custom sorting dictionary python pass hashmap","difference between dictionary and hashmap python","hashmap equivalent in python","hashmap implementation python","hashmap in python","hashmap in python geeksforgeeks","hashmap put in python","hashmap python","hashmap python implementation","hashmap vs dictionary python","hashmap with multiple keys python","implement a hashmap in python","implement hashmap in python","python dictionary vs hashmap","python hashmap","python hashmap contains","python hashmap example","python hashmap implementation","python hashmap keys to array","python hashmap list","python hashmap remove","python hashmap vs dictionary","sort hashmap by value python"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/python-hashmaps\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/python-hashmaps\/","url":"https:\/\/www.pythonpool.com\/python-hashmaps\/","name":"Python Hashmaps | Implementing using Dictionary - Python Pool","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/python-hashmaps\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/python-hashmaps\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/Capture-6.jpg","datePublished":"2020-06-23T11:36:55+00:00","dateModified":"2024-01-01T06:52:11+00:00","description":"python hashmaps stores data in the form of key-value pair. It is generally used for easy and fast retrieval. Hashmaps data can be retrieved with key.","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/python-hashmaps\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/python-hashmaps\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/python-hashmaps\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/Capture-6.jpg","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/06\/Capture-6.jpg","width":1000,"height":605,"caption":"python hashmaps"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/python-hashmaps\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"Python Hashmaps | Implementing using Dictionary"}]},{"@type":"WebSite","@id":"https:\/\/www.pythonpool.com\/#website","url":"https:\/\/www.pythonpool.com\/","name":"Python Pool","description":"Your One-Stop Python Learning Destination","publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pythonpool.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.pythonpool.com\/#organization","name":"Python Pool","url":"https:\/\/www.pythonpool.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/","url":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","contentUrl":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","width":452,"height":185,"caption":"Python Pool"},"image":{"@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/pythonpool","https:\/\/www.youtube.com\/c\/pythonpool"]},{"@type":"Person","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/8a75fb48eb1f3dc952df65a8c28ac056","name":"Ashwini Mandani","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f765ed1940ac0ae1d30ce4cb2f1452c1e83143b07354d25a42c1cd118980e269?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f765ed1940ac0ae1d30ce4cb2f1452c1e83143b07354d25a42c1cd118980e269?s=96&d=wavatar&r=g","caption":"Ashwini Mandani"}}]}},"_links":{"self":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/3329","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=3329"}],"version-history":[{"count":7,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/3329\/revisions"}],"predecessor-version":[{"id":31456,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/3329\/revisions\/31456"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/3335"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=3329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=3329"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=3329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}