{"id":3970,"date":"2020-08-27T12:28:48","date_gmt":"2020-08-27T06:58:48","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=3970"},"modified":"2024-01-01T14:54:09","modified_gmt":"2024-01-01T09:24:09","slug":"matplotlib-heatmap","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/","title":{"rendered":"Matplotlib Heatmap: Data Visualization Made Easy"},"content":{"rendered":"\n<p>Do you want to represent and understand complex data? The best way to do it will be by using heatmaps. Heatmap is a data visualization technique, which represents data using different colours in <strong>two dimensions<\/strong>. In Python, we can create a heatmap using <em>matplotlib and seaborn library<\/em>. Although there is no direct method using which we can create heatmaps using matplotlib, we can use the <a href=\"http:\/\/www.pythonpool.com\/matplotlib-imshow\/\">matplotlib imshow<\/a> function to create heatmaps.&nbsp;&nbsp;<\/p>\n\n\n\n<p><strong>In a Matplotlib heatmap, every value (every cell of a matrix) is represented by a different color. Data Scientists generally use heatmaps when they want to understand the correlation between various features of a data frame. If you are unaware of all these terms, don\u2019t worry, you will get a basic idea about it when discussing its implementation.&nbsp;<\/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\/matplotlib-heatmap\/#Syntax_of_Matplotlib_Heatmap\" >Syntax&nbsp;of Matplotlib Heatmap<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#Parameters\" >Parameters-&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#Return_Type\" >Return Type&nbsp;<\/a><\/li><\/ul><\/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\/matplotlib-heatmap\/#Heatmaps_using_Matplotlib\" >Heatmaps using Matplotlib&nbsp;<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#Creating_our_First_Heatmap_using_matplotlib\" >Creating our First Heatmap&nbsp;using matplotlib<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#Playing_with_interpolation_and_cmap_parameters\" >Playing with interpolation and cmap parameters<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#Adding_Colorbar_in_Heatmap_using_Matplotlib\" >Adding Colorbar in Heatmap using Matplotlib<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#Correlation_Between_Features_in_Pandas_Dataframe_using_matplotlib_Heatmap\" >Correlation Between Features in Pandas Dataframe using matplotlib Heatmap<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#Heatmaps_using_Seaborn\" >Heatmaps using Seaborn<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#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-11\" href=\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-syntax-of-matplotlib-heatmap\"><span class=\"ez-toc-section\" id=\"Syntax_of_Matplotlib_Heatmap\"><\/span>Syntax&nbsp;of Matplotlib Heatmap<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To generate a heatmap using matplotlib, we will use the imshow function of matplotlib.pyplot and two of its parameters \u2013<strong> \u2018interpolation\u2019 and \u2018cmap.\u2019 <\/strong>Let us understand these parameters.&nbsp;<\/p>\n\n\n\n<p>Before that, you need to install matplotlib library in your systems if you have not already installed. You need to use this command \u2013 <strong>pip install matplotlib.&nbsp;<\/strong><\/p>\n\n\n\n<p><strong>imshow(data, cmap=None,interpolation=None)&nbsp;<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-parameters\"><span class=\"ez-toc-section\" id=\"Parameters\"><\/span>Parameters-&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Data<\/strong> \u2013 In this data parameter, we have to pass a 2D array as an input.&nbsp;<\/li>\n\n\n\n<li><strong>Cmap<\/strong>&#8211; Using this parameter, we can give colour to our graph. We can choose the colour from the below options.&nbsp;<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"203\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/Screenshot-432-1024x203.png\" alt=\"Heatmap data\" class=\"wp-image-3977\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/Screenshot-432-1024x203.png 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/Screenshot-432-300x60.png 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/Screenshot-432-768x153.png 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/Screenshot-432.png 1284w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Interpolation<\/strong> \u2013 Different types of graphs can be created. We can choose any of the following values and fill in the interpolation parameter.&nbsp;<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">antialiased, none, nearest, bilinear, bicubic, spline16, spline36, hanning, hamming, hermite, kaiser, quadric, catrom, gaussian, bessel, mitchell, sinc, lanczos, blackman<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-return-type\"><span class=\"ez-toc-section\" id=\"Return_Type\"><\/span>Return Type&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>&lt;class &#8216;matplotlib.image.AxesImage&#8217;&gt;&nbsp;<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-heatmaps-using-matplotlib\"><span class=\"ez-toc-section\" id=\"Heatmaps_using_Matplotlib\"><\/span>Heatmaps using Matplotlib&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-creating-our-first-heatmap-using-matplotlib\"><span class=\"ez-toc-section\" id=\"Creating_our_First_Heatmap_using_matplotlib\"><\/span>Creating our First Heatmap&nbsp;using matplotlib<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Suppose we have marks obtained by different students in different subjects out of 100. Let us see how we can use heatmaps to represent this data.&nbsp;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport matplotlib.pyplot as plt\n\n# Create a array of marks in different subjects scored by different students \nmarks = np.array(&#x5B;&#x5B;50, 74, 40, 59,90, 98],\n                    &#x5B;72, 85, 64, 33, 47, 87],\n                    &#x5B;52, 97, 44, 73, 17, 56],\n                    &#x5B;69, 45, 89, 79,70, 48],\n                    &#x5B;87, 65, 56, 86, 72, 68],\n                    &#x5B;90, 29, 78, 66, 50, 32]])\n# name of students\nnames=&#x5B;'Sumit','Ashu','Sonu','Kajal','Kavita','Naman']\n# name of subjects\nsubjects=&#x5B;'Maths','Hindi','English','Social Studies','Science','Computer Science']\n\n# Setting the labels of x axis.\n# set the xticks as student-names\n# rotate the labels by 90 degree to fit the names\nplt.xticks(ticks=np.arange(len(names)),labels=names,rotation=90)\n# Setting the labels of y axis.\n# set the xticks as subject-names\nplt.yticks(ticks=np.arange(len(subjects)),labels=subjects)\n# use the imshow function to generate a heatmap\n# cmap parameter gives color to the graph\n# setting the interpolation will lead to different types of graphs\nplt.imshow(marks, cmap='cool',interpolation=&quot;nearest&quot;)\n<\/pre><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"329\" height=\"277\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/download-3.png\" alt=\"matplotlib heatmap\" class=\"wp-image-3972\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/download-3.png 329w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/download-3-300x253.png 300w\" sizes=\"(max-width: 329px) 100vw, 329px\" \/><\/figure><\/div>\n\n\n<p>In the above heatmap, <em>dark colors show good marks,<\/em> and <em>light color shows bad marks<\/em>. <strong>Heatmaps adjust the brightness of the color according to the highest and lowest<\/strong> marks in the dataset. The highest score is represented by the darkest color and the lowest score by the brightest color.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-playing-with-interpolation-and-cmap-parameters\"><span class=\"ez-toc-section\" id=\"Playing_with_interpolation_and_cmap_parameters\"><\/span>Playing with interpolation and cmap parameters <span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Let us now change the cmap and interpolation on the same data and see what are the varieties of graphs we can make. <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport matplotlib.pyplot as plt\nmarks = np.array(&#x5B;&#x5B;50, 74, 40, 59,90, 98],\n                    &#x5B;72, 85, 64, 33, 47, 87],\n                    &#x5B;52, 97, 44, 73, 17, 56],\n                    &#x5B;69, 45, 89, 79,70, 48],\n                    &#x5B;87, 65, 56, 86, 72, 68],\n                    &#x5B;90, 29, 78, 66, 50, 32]])\n\nnames=&#x5B;'Sumit','Ashu','Sonu','Kajal','Kavita','Naman']\nsubjects=&#x5B;'Maths','Hindi','English','Social Studies','Science','Computer Science']\n\nplt.xticks(ticks=np.arange(len(names)),labels=names,rotation=90)\nplt.yticks(ticks=np.arange(len(subjects)),labels=subjects)\n# set the cmap as Blues and interpolation as spline16\nplt.imshow(marks, cmap='Blues',interpolation=&quot;spline16&quot;)\n<\/pre><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"329\" height=\"277\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/download-5.png\" alt=\"matplotlib heatmap\" class=\"wp-image-3973\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/download-5.png 329w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/download-5-300x253.png 300w\" sizes=\"(max-width: 329px) 100vw, 329px\" \/><\/figure><\/div>\n\n\n<p>In this graph whenever the marks are more, the color is quite dark, and where the score is less, the color is lighter.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-adding-colorbar-in-heatmap-using-matplotlib\"><span class=\"ez-toc-section\" id=\"Adding_Colorbar_in_Heatmap_using_Matplotlib\"><\/span>Adding Colorbar in Heatmap using Matplotlib<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Colorbar can simply be understood as a scale that helps us understand which color represents which value. Also, there is a direct function in matplotlib for adding a color bar to the graph. Let us use the same data as above for this purpose.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport matplotlib.pyplot as plt\nmarks = np.array(&#x5B;&#x5B;50, 74, 40, 59,90, 98],\n                    &#x5B;72, 85, 64, 33, 47, 87],\n                    &#x5B;52, 97, 44, 73, 17, 56],\n                    &#x5B;69, 45, 89, 79,70, 48],\n                    &#x5B;87, 65, 56, 86, 72, 68],\n                    &#x5B;90, 29, 78, 66, 50, 32]])\n\nnames=&#x5B;'Sumit','Ashu','Sonu','Kajal','Kavita','Naman']\nsubjects=&#x5B;'Maths','Hindi','English','Social Studies','Science','Computer Science']\n\nplt.xticks(ticks=np.arange(len(names)),labels=names,rotation=90)\nplt.yticks(ticks=np.arange(len(subjects)),labels=subjects)\n# save this plot inside a variable called hm\nhm=plt.imshow(marks, cmap='Blues',interpolation=&quot;nearest&quot;)\n# pass this heatmap object into plt.colorbar method.\nplt.colorbar(hm)\n<\/pre><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"377\" height=\"274\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/download-6.png\" alt=\"Colorbar in Heatmap \" class=\"wp-image-3984\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/download-6.png 377w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/download-6-300x218.png 300w\" sizes=\"(max-width: 377px) 100vw, 377px\" \/><\/figure><\/div>\n\n\n<p>You can see a vertical line around the heatmap. This is a color bar. It clearly indicates that, for higher marks, the color is dark and for lower marks, the color is a lighter shade.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-correlation-between-features-in-pandas-dataframe-using-matplotlib-heatmap\"><span class=\"ez-toc-section\" id=\"Correlation_Between_Features_in_Pandas_Dataframe_using_matplotlib_Heatmap\"><\/span>Correlation Between Features in Pandas Dataframe using matplotlib Heatmap <span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>One of the greatest applications of the heatmap is to analyze the correlation between different features of a<a href=\"https:\/\/en.wikipedia.org\/?title=Data_frame&amp;redirect=no\" target=\"_blank\" rel=\"noreferrer noopener\"> data frame<\/a>.<strong> Features mean columns and correlation is how much values in these columns are related to each other.<\/strong> <\/p>\n\n\n\n<p>Let us take a data frame and analyze the correlation between its features using a heatmap.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n# this is our data\nx=&#x5B;&#x5B;1.,337.,118.,4.,4.5 ,4.5 ,9.65,1.,0.92],&#x5B;2.,324.,107.,4.,4.,4.5 ,8.87,1.,0.76],&#x5B;3.,316.,104.,3.,3.,3.5 ,8.,1.,0.72],\n&#x5B;4.,322.,110.,3.,3.5 ,2.5 ,8.67,1.,0.8 ],&#x5B;5.,314.,103.,2.,2.,3.,8.21,0.,0.65],&#x5B;6.,330.,115.,5.,4.5 ,3.,9.34,1.,0.9 ],\n&#x5B;7.,321.,109.,3.,3.,4.,8.2 ,1.,0.75],&#x5B;8.,308.,101.,2.,3.,4.,7.9 ,0.,0.68],&#x5B;9.,302.,102.,1.,2.,1.5 ,8.,0.,0.5 ],\n&#x5B; 10.,323.,108.,3.,3.5 ,3.,8.6 ,0.,0.45],&#x5B; 11.,325.,106.,3.,3.5 ,4.,8.4 ,1.,0.52],&#x5B; 12.,327.,111.,4.,4.,4.5 ,9.,1.,0.84],\n&#x5B; 13.,328.,112.,4.,4.,4.5 ,9.1 ,1.,0.78],&#x5B; 14.,307.,109.,3.,4.,3.,8.,1.,0.62],&#x5B; 15.,311.,104.,3.,3.5 ,2.,8.2 ,1.,0.61],\n&#x5B; 16.,314.,105.,3.,3.5 ,2.5 ,8.3 ,0.,0.54],&#x5B; 17.,317.,107.,3.,4.,3.,8.7 ,0.,0.66],&#x5B; 18.,319.,106.,3.,4.,3.,8.,1.,0.65],\n&#x5B; 19.,318.,110.,3.,4.,3.,8.8 ,0.,0.63],&#x5B; 20.,303.,102.,3.,3.5 ,3.,8.5 ,0.,0.62],&#x5B; 21.,312.,107.,3.,3.,2.,7.9 ,1.,0.64],\n&#x5B; 22.,325.,114.,4.,3.,2.,8.4 ,0.,0.7 ],&#x5B; 23.,328.,116.,5.,5.,5.,9.5 ,1.,0.94],&#x5B; 24.,334.,119.,5.,5.,4.5 ,9.7 ,1.,0.95],\n&#x5B; 25.,336.,119.,5.,4.,3.5 ,9.8 ,1.,0.97],&#x5B; 26.,340.,120.,5.,4.5 ,4.5 ,9.6 ,1.,0.94],\n&#x5B; 27.,322.,109.,5.,4.5 ,3.5 ,8.8 ,0.,0.76],&#x5B; 28.,298.,98.,2.,1.5 ,2.5 ,7.5 ,1.,0.44],&#x5B; 29.,295.,93.,1.,2.,2.,7.2 ,0.,0.46],\n&#x5B; 30.,310.,99.,2.,1.5 ,2.,7.3 ,0.,0.54],&#x5B; 31.,300.,97.,2.,3.,3.,8.1 ,1.,0.65],\n&#x5B; 32.,327.,103.,3.,4.,4.,8.3 ,1.,0.74], &#x5B; 33.,338.,118.,4.,3.,4.5 ,9.4 ,1.,0.91], &#x5B; 34.,340.,114.,5.,4.,4.,9.6 ,1.,0.9 ],\n&#x5B; 35.,331.,112.,5.,4.,5.,9.8 ,1.,0.94], &#x5B; 36.,320.,110.,5.,5.,5.,9.2 ,1.,0.88],\n&#x5B; 37.,299.,106.,2.,4.,4.,8.4 ,0.,0.64], &#x5B; 38.,300.,105.,1.,1.,2.,7.8 ,0.,0.58], &#x5B; 39.,304.,105.,1.,3.,1.5 ,7.5 ,0.,0.52],\n&#x5B; 40.,307.,108.,2.,4.,3.5 ,7.7 ,0.,0.48], &#x5B; 41.,308.,110.,3.,3.5 ,3.,8.,1.,0.46], &#x5B; 42.,316.,105.,2.,2.5 ,2.5 ,8.2 ,1.,0.49],\n&#x5B; 43.,313.,107.,2.,2.5 ,2.,8.5 ,1.,0.53], &#x5B; 44.,332.,117.,4.,4.5 ,4.,9.1 ,0.,0.87], &#x5B; 45.,326.,113.,5.,4.5 ,4.,9.4 ,1.,0.91],\n&#x5B; 46.,322.,110.,5.,5.,4.,9.1 ,1.,0.88], &#x5B; 47.,329.,114.,5.,4.,5.,9.3 ,1.,0.86], &#x5B; 48.,339.,119.,5.,4.5 ,4.,9.7 ,0.,0.89],\n&#x5B; 49.,321.,110.,3.,3.5 ,5.,8.85,1.,0.82], &#x5B; 50.,327.,111.,4.,3.,4.,8.4 ,1.,0.78]]\n\n# column name\ncolumns=&#x5B;'Serial No.', 'GRE Score', 'TOEFL Score', 'University Rating', 'SOP',\n       'LOR ', 'CGPA', 'Research', 'Chance of Admit ']\n\n# create a dataframe with the above values and column names \ndataset=pd.DataFrame(data=x,columns=columns)\n\n# to find the correlation, use corr() method on the dataset\ncorr=dataset.corr()\n\nplt.xticks(range(len(columns)),columns,rotation=90)\nplt.yticks(range(len(columns)),columns)\nplt.imshow(corr, cmap='hot',interpolation=&quot;nearest&quot;)\n<\/pre><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"324\" height=\"324\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/download-2.png\" alt=\"matplotlib heatmap\" class=\"wp-image-3974\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/download-2.png 324w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/download-2-300x300.png 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/download-2-150x150.png 150w\" sizes=\"(max-width: 324px) 100vw, 324px\" \/><\/figure><\/div>\n\n\n<p>In the above heatmap, the lighter the value, the more the correlation between the features. You can see that if we want to check which features are more correlated to the Chance of Admit, you will see the following row-<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"388\" height=\"170\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/Screenshot-431.png\" alt=\"Colorbar in Heatmap \" class=\"wp-image-3971\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/Screenshot-431.png 388w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/Screenshot-431-300x131.png 300w\" sizes=\"(max-width: 388px) 100vw, 388px\" \/><\/figure><\/div>\n\n\n<p><strong>Notice that for higher Chance of admission, CGPA and University matters the most because they have very bright colors. Also, Serial No. and research don&#8217;t matter that much.<\/strong> This is how we take advantage of heatmaps in <a href=\"http:\/\/www.pythonpool.com\/data-science-internship\/\">data science<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-heatmaps-using-seaborn\"><span class=\"ez-toc-section\" id=\"Heatmaps_using_Seaborn\"><\/span>Heatmaps using Seaborn<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>Seaborn is a data visualization library that is built on top of matplotlib<\/strong> and contains a direct function to create heatmaps. Before using seaborn, install it in your systems using <strong>pip install seaborn.<\/strong><\/p>\n\n\n\n<p>We will use the above data to see how seaborn heatmaps can be created.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# import the seaborn library and give alias as sns\nimport seaborn as sns\n# use heatmap function, set the color as viridis and\n# make each cell seperate using linewidth parameter\nsns.heatmap(corr,linewidths=2,cmap=&quot;viridis&quot;)\n<\/pre><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"425\" height=\"328\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/download-4.png\" alt=\"heatmap in matplotlib\" class=\"wp-image-3975\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/download-4.png 425w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/download-4-300x232.png 300w\" sizes=\"(max-width: 425px) 100vw, 425px\" \/><\/figure><\/div>\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>To analyse and visualize data in a better way, we can use heatmaps. To create heatmaps using matplotlib, we need to use imshow function with <a href=\"http:\/\/www.pythonpool.com\/matplotlib-cmap\/\" target=\"_blank\" rel=\"noreferrer noopener\">cmap<\/a> and interpolation parameters. Data Scientist generally use heatmaps for analysing the correlation between different features of a dataset. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Do you want to represent and understand complex data? The best way to do it will be by using heatmaps. Heatmap is a data visualization &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Matplotlib Heatmap: Data Visualization Made Easy\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#more-3970\" aria-label=\"More on Matplotlib Heatmap: Data Visualization Made Easy\">Read more<\/a><\/p>\n","protected":false},"author":3,"featured_media":3988,"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":[2071],"tags":[2059,2054,2048,2051,2052,2049,2057,2068,2050,2053,2056,2063,2047,2055,2061],"class_list":["post-3970","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-matplotlib","tag-fft-power-spectrum-matplotlib-heatmap","tag-heatmap-in-matplotlib","tag-heatmap-matplotlib","tag-heatmap-python-matplotlib","tag-matplotlib-3d-heatmap","tag-matplotlib-heatmap","tag-matplotlib-heatmap-colorbar","tag-matplotlib-heatmap-colorbar-title","tag-matplotlib-heatmap-colors","tag-matplotlib-heatmap-example","tag-matplotlib-lat-long-heatmap","tag-pyplot-heatmap-sharper-borders-matplotlib-1-5","tag-python-heatmap-matplotlib","tag-python-matplotlib-heatmap","tag-subplots-heatmap-spacing-matplotlib","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>Matplotlib Heatmap: Data Visualization Made Easy - Python Pool<\/title>\n<meta name=\"description\" content=\"Matplotlib Heatmap is used to represent the matrix of data in the form of different colours. We can create a heatmap using imshow function.\" \/>\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\/matplotlib-heatmap\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Matplotlib Heatmap: Data Visualization Made Easy\" \/>\n<meta property=\"og:description\" content=\"Do you want to represent and understand complex data? The best way to do it will be by using heatmaps. Heatmap is a data visualization technique, which\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2020-08-27T06:58:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-01T09:24:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/Theatre-Actor-Portfolio-Website-5.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1350\" \/>\n\t<meta property=\"og:image:height\" content=\"650\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\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=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/\"},\"author\":{\"name\":\"Ashwini Mandani\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/8a75fb48eb1f3dc952df65a8c28ac056\"},\"headline\":\"Matplotlib Heatmap: Data Visualization Made Easy\",\"datePublished\":\"2020-08-27T06:58:48+00:00\",\"dateModified\":\"2024-01-01T09:24:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/\"},\"wordCount\":763,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/Theatre-Actor-Portfolio-Website-5.png\",\"keywords\":[\"fft power spectrum matplotlib heatmap\",\"heatmap in matplotlib\",\"heatmap matplotlib\",\"heatmap python matplotlib\",\"matplotlib 3d heatmap\",\"matplotlib heatmap\",\"matplotlib heatmap colorbar\",\"matplotlib heatmap colorbar title\",\"matplotlib heatmap colors\",\"matplotlib heatmap example\",\"matplotlib lat long heatmap\",\"pyplot heatmap sharper borders matplotlib 1.5\",\"python heatmap matplotlib\",\"python matplotlib heatmap\",\"subplots heatmap spacing matplotlib\"],\"articleSection\":[\"Matplotlib\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/\",\"url\":\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/\",\"name\":\"Matplotlib Heatmap: Data Visualization Made Easy - Python Pool\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/Theatre-Actor-Portfolio-Website-5.png\",\"datePublished\":\"2020-08-27T06:58:48+00:00\",\"dateModified\":\"2024-01-01T09:24:09+00:00\",\"description\":\"Matplotlib Heatmap is used to represent the matrix of data in the form of different colours. We can create a heatmap using imshow function.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/Theatre-Actor-Portfolio-Website-5.png\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/Theatre-Actor-Portfolio-Website-5.png\",\"width\":1350,\"height\":650,\"caption\":\"matplotlib heatmap\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Matplotlib Heatmap: Data Visualization Made Easy\"}]},{\"@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":"Matplotlib Heatmap: Data Visualization Made Easy - Python Pool","description":"Matplotlib Heatmap is used to represent the matrix of data in the form of different colours. We can create a heatmap using imshow function.","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\/matplotlib-heatmap\/","og_locale":"en_US","og_type":"article","og_title":"Matplotlib Heatmap: Data Visualization Made Easy","og_description":"Do you want to represent and understand complex data? The best way to do it will be by using heatmaps. Heatmap is a data visualization technique, which","og_url":"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/","og_site_name":"Python Pool","article_published_time":"2020-08-27T06:58:48+00:00","article_modified_time":"2024-01-01T09:24:09+00:00","og_image":[{"width":1350,"height":650,"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/Theatre-Actor-Portfolio-Website-5.png","type":"image\/png"}],"author":"Ashwini Mandani","twitter_card":"summary_large_image","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Ashwini Mandani","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/"},"author":{"name":"Ashwini Mandani","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/8a75fb48eb1f3dc952df65a8c28ac056"},"headline":"Matplotlib Heatmap: Data Visualization Made Easy","datePublished":"2020-08-27T06:58:48+00:00","dateModified":"2024-01-01T09:24:09+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/"},"wordCount":763,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/Theatre-Actor-Portfolio-Website-5.png","keywords":["fft power spectrum matplotlib heatmap","heatmap in matplotlib","heatmap matplotlib","heatmap python matplotlib","matplotlib 3d heatmap","matplotlib heatmap","matplotlib heatmap colorbar","matplotlib heatmap colorbar title","matplotlib heatmap colors","matplotlib heatmap example","matplotlib lat long heatmap","pyplot heatmap sharper borders matplotlib 1.5","python heatmap matplotlib","python matplotlib heatmap","subplots heatmap spacing matplotlib"],"articleSection":["Matplotlib"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/","url":"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/","name":"Matplotlib Heatmap: Data Visualization Made Easy - Python Pool","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/Theatre-Actor-Portfolio-Website-5.png","datePublished":"2020-08-27T06:58:48+00:00","dateModified":"2024-01-01T09:24:09+00:00","description":"Matplotlib Heatmap is used to represent the matrix of data in the form of different colours. We can create a heatmap using imshow function.","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/matplotlib-heatmap\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/Theatre-Actor-Portfolio-Website-5.png","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/Theatre-Actor-Portfolio-Website-5.png","width":1350,"height":650,"caption":"matplotlib heatmap"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/matplotlib-heatmap\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"Matplotlib Heatmap: Data Visualization Made Easy"}]},{"@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\/3970","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=3970"}],"version-history":[{"count":13,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/3970\/revisions"}],"predecessor-version":[{"id":31564,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/3970\/revisions\/31564"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/3988"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=3970"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=3970"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=3970"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}