

{"id":23022,"date":"2018-07-27T04:00:16","date_gmt":"2018-07-27T04:00:16","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=23022"},"modified":"2026-04-29T12:45:22","modified_gmt":"2026-04-29T07:15:22","slug":"python-histogram-python-bar","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/python-histogram-python-bar\/","title":{"rendered":"Python Histogram | Python Bar Plot (Matplotlib &amp; Seaborn)"},"content":{"rendered":"<p><span style=\"font-weight: 400\">Today, we will see how we can create a Python Histogram and a Python Bar Plot using <a href=\"https:\/\/data-flair.training\/blogs\/python-matplotlib-tutorial\/\" target=\"_blank\" rel=\"noopener\"><strong>Matplotlib<\/strong><\/a> and Seaborn <strong><a href=\"https:\/\/data-flair.training\/blogs\/python-library\/\" target=\"_blank\" rel=\"noopener\">Python libraries<\/a><\/strong>. Moreover, in this Python Histogram and Bar Plotting Tutorial, we will understand Histograms and Bars in Python with the help of examples and graphs.<\/span><\/p>\n<p>So, let&#8217;s understand the Histogram and Bar Plot in Python.<\/p>\n<h3><strong>Python Histogram<\/strong><\/h3>\n<p><span style=\"font-weight: 400\">A histogram is a graph that represents the way numerical data is represented. The input to it is a numerical variable, which it separates into <\/span><i><span style=\"font-weight: 400\">bins<\/span><\/i><span style=\"font-weight: 400\"> on the x-axis. This is a vector of numbers and can be a list or a DataFrame column. A higher bar represents more observations per bin. Also, the number of bins decides the shape of the histogram.<\/span><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/python-packages\/\" target=\"_blank\" rel=\"noopener\">Do you know about Python Packages<\/a><\/strong><\/p>\n<p><strong>Types of Histograms:<\/strong><\/p>\n<ul>\n<li><strong>Standard histogram:<\/strong> It is represented with the help of bars.<\/li>\n<li><strong>Stacked histogram:<\/strong> It helps in comparing multiple datasets by placing the bars on top of each other.<\/li>\n<li><strong>Step histogram:<\/strong> It is similar to waterfall or line graphs, but it is often used to display the data without filling the bars.<\/li>\n<li><strong>Cumulative histogram:<\/strong> It is used to show the total number of times a value has occurred in a given time.<\/li>\n<\/ul>\n<h4><strong>a. Example of Python Histogram<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">Let\u2019s begin with a simple <em>Matplotlib Histogram Example<\/em>.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; import seaborn as sn\r\n&gt;&gt;&gt; df=sn.load_dataset(\u2018iris\u2019)\r\n&gt;&gt;&gt; sn.distplot(df['sepal_length'])<\/pre>\n<p><strong>&lt;matplotlib.axes._subplots.AxesSubplot object at 0x07837230<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; import matplotlib.pyplot as plt\r\n&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_23025\" style=\"width: 584px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/1-2-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-23025\" class=\"wp-image-23025 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/1-2-1.png\" alt=\"Python Histogram\" width=\"574\" height=\"446\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/1-2-1.png 574w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/1-2-1-150x117.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/1-2-1-300x233.png 300w\" sizes=\"auto, (max-width: 574px) 100vw, 574px\" \/><\/a><p id=\"caption-attachment-23025\" class=\"wp-caption-text\">Python Matplotlib Histogram Example<\/p><\/div>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; sn.distplot(df['sepal_length'],bins=25)<\/pre>\n<p><strong>&lt;matplotlib.axes._subplots.AxesSubplot object at 0x07837230&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_23026\" style=\"width: 583px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/2-3-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-23026\" class=\"wp-image-23026 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/2-3-1.png\" alt=\"Python Histogram\" width=\"573\" height=\"448\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/2-3-1.png 573w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/2-3-1-150x117.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/2-3-1-300x235.png 300w\" sizes=\"auto, (max-width: 573px) 100vw, 573px\" \/><\/a><p id=\"caption-attachment-23026\" class=\"wp-caption-text\">Python Matplotlib Histogram Example<\/p><\/div>\n<p><span style=\"font-weight: 400\">To plot this without Seaborn, we can do the following-<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; import numpy as np\r\n&gt;&gt;&gt; from matplotlib import colors\r\n&gt;&gt;&gt; from matplotlib.ticker import PercentFormatter\r\n&gt;&gt;&gt; np.random.seed(19720810)\r\n&gt;&gt;&gt; N=100000\r\n&gt;&gt;&gt; n_bins=20\r\n&gt;&gt;&gt; x=np.random.randn(N)\r\n&gt;&gt;&gt; y=.7*x+np.random.randn(100000)+7\r\n&gt;&gt;&gt; fig,axs=plt.subplots(1,2,sharey=True,tight_layout=True)\r\n&gt;&gt;&gt; axs[0].hist(x,bins=n_bins)\r\n&gt;&gt;&gt; axs[1].hist(y,bins=n_bins)\r\n&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_23027\" style=\"width: 639px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/3-3-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-23027\" class=\"wp-image-23027 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/3-3-1.png\" alt=\"Python Histogram\" width=\"629\" height=\"467\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/3-3-1.png 629w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/3-3-1-150x111.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/3-3-1-300x223.png 300w\" sizes=\"auto, (max-width: 629px) 100vw, 629px\" \/><\/a><p id=\"caption-attachment-23027\" class=\"wp-caption-text\">Example &#8211; Matplotlib Histogram in Python<\/p><\/div>\n<h4><strong>b. Displaying Only The Histogram<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">We can choose to show or hide the Python Histogram, the rug, and the kernel density. Let\u2019s try displaying only the Python Histogram for now.<\/span><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/python-web-framework\/\" target=\"_blank\" rel=\"noopener\">Let&#8217;s revise Python Web Framework<\/a><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; sn.distplot(a=df['sepal_length'],hist=True,kde=False,rug=False)<\/pre>\n<p><strong>&lt;matplotlib.axes._subplots.AxesSubplot object at 0x0955C310&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_23034\" style=\"width: 583px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/4-4-2.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-23034\" class=\"wp-image-23034 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/4-4-2.png\" alt=\"Python Histogram\" width=\"573\" height=\"445\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/4-4-2.png 573w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/4-4-2-150x116.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/4-4-2-300x233.png 300w\" sizes=\"auto, (max-width: 573px) 100vw, 573px\" \/><\/a><p id=\"caption-attachment-23034\" class=\"wp-caption-text\">Displaying Only The Histogram<\/p><\/div>\n<h4><strong>c. Displaying Histogram, Rug, and Kernel Density<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">Now let\u2019s try displaying all three.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; sn.distplot(a=df['sepal_length'],hist=True,kde=True,rug=True)<\/pre>\n<p><strong><span style=\"font-family: Verdana, Geneva, sans-serif\">&lt;matplotlib.axes._subplots.AxesSubplot object at 0x09526EB0&gt;<\/span><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_23035\" style=\"width: 572px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/5-3-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-23035\" class=\"wp-image-23035 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/5-3-1.png\" alt=\"Python Histogram\" width=\"562\" height=\"439\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/5-3-1.png 562w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/5-3-1-150x117.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/5-3-1-300x234.png 300w\" sizes=\"auto, (max-width: 562px) 100vw, 562px\" \/><\/a><p id=\"caption-attachment-23035\" class=\"wp-caption-text\">Displaying Histogram, Rug, and Kernel Density<\/p><\/div>\n<h4><strong>d. Customizing the rug in Histogram<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">Let\u2019s set the rug to red.<\/span><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/python-datetime-module\/\" target=\"_blank\" rel=\"noopener\">Let&#8217;s learn about Python Datetime Module<\/a><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; sn.distplot(a=df['sepal_length'],rug=True,rug_kws={'color':'r','alpha':0.35,'linewidth':5})<\/pre>\n<p><strong>&lt;matplotlib.axes._subplots.AxesSubplot object at 0x07B18BD0&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_23036\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/6-3-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-23036\" class=\"wp-image-23036 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/6-3-1.png\" alt=\"Python Histogram\" width=\"565\" height=\"442\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/6-3-1.png 565w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/6-3-1-150x117.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/6-3-1-300x235.png 300w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/a><p id=\"caption-attachment-23036\" class=\"wp-caption-text\">Customizing the rug<\/p><\/div>\n<h4><strong>e. Customizing the density distribution<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">Using keywords for kernel density, we can customize the density distribution.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; sn.distplot(a=df['sepal_length'],kde=True,kde_kws={'color':'r','alpha':0.35,'linewidth':5})<\/pre>\n<p><strong>&lt;matplotlib.axes._subplots.AxesSubplot object at 0x07E5B7D0&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_23037\" style=\"width: 586px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/7-4.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-23037\" class=\"wp-image-23037 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/7-4.png\" alt=\"Python Histogram\" width=\"576\" height=\"444\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/7-4.png 576w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/7-4-150x116.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/7-4-300x231.png 300w\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" \/><\/a><p id=\"caption-attachment-23037\" class=\"wp-caption-text\">Customizing the density distribution<\/p><\/div>\n<h4>f. Vertical Python Histogram<\/h4>\n<p><span style=\"font-weight: 400\">Now let\u2019s try making a vertical Python Histogram.<\/span><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/python-numpy-tutorial\/\" target=\"_blank\" rel=\"noopener\">Let&#8217;s learn about Python Numpy<\/a><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; sn.distplot(df['sepal_length'],color='lightpink',vertical=True)<\/pre>\n<p><strong>&lt;matplotlib.axes._subplots.AxesSubplot object at 0x07DCD6D0&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_23038\" style=\"width: 585px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/8-1-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-23038\" class=\"wp-image-23038 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/8-1-1.png\" alt=\"Python Histogram\" width=\"575\" height=\"424\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/8-1-1.png 575w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/8-1-1-150x111.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/8-1-1-300x221.png 300w\" sizes=\"auto, (max-width: 575px) 100vw, 575px\" \/><\/a><p id=\"caption-attachment-23038\" class=\"wp-caption-text\">Vertical Python Histogram<\/p><\/div>\n<h4><strong>g. Python Histogram with multiple variables<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">We can view together the histograms for multiple numeric variables.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; sn.distplot(df['sepal_length'],color='skyblue',label='Sepal length')<\/pre>\n<p><strong>&lt;matplotlib.axes._subplots.AxesSubplot object at 0x0849ABB0&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; sn.distplot(df['sepal_width'],color='lightpink',label='Sepal width')<\/pre>\n<p><strong>&lt;matplotlib.axes._subplots.AxesSubplot object at 0x0849ABB0&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_23039\" style=\"width: 578px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/9-1-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-23039\" class=\"wp-image-23039 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/9-1-1.png\" alt=\"Python Histogram\" width=\"568\" height=\"447\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/9-1-1.png 568w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/9-1-1-150x118.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/9-1-1-300x236.png 300w\" sizes=\"auto, (max-width: 568px) 100vw, 568px\" \/><\/a><p id=\"caption-attachment-23039\" class=\"wp-caption-text\">Multiple variables with\u00a0Histogram in Python<\/p><\/div>\n<h3><strong>Python Bar Plot<\/strong><\/h3>\n<p><span style=\"font-weight: 400\">A bar plot in Python, also known as a bar chart, represents how a numerical variable relates to a categorical variable.<\/span><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/pandas-tutorial\/\" target=\"_blank\" rel=\"noopener\">Let&#8217;s have a look at Python Pandas<\/a><\/strong><\/p>\n<h4><strong>a. Example of Python Bar Plot<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">Let\u2019s take a quick<em> Matplotlib Bar Chart Example<\/em>.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; import numpy as np\r\n&gt;&gt;&gt; import matplotlib.pyplot as plt\r\n&gt;&gt;&gt; marks=[79,45,22,89,95]\r\n&gt;&gt;&gt; bars=('Roll 1','Roll 2','Roll 3','Roll 4','Roll 5')\r\n&gt;&gt;&gt; y=np.arange(len(bars))\r\n&gt;&gt;&gt; plt.bar(y,marks,color=\u2019g\u2019)<\/pre>\n<p><strong>&lt;BarContainer object of 5 artists&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.xticks(y,bars)<\/pre>\n<p><strong>([&lt;matplotlib.axis.XTick object at 0x0942EFD0&gt;, &lt;matplotlib.axis.XTick object at 0x0942E3B0&gt;, &lt;matplotlib.axis.XTick object at 0x0942E2B0&gt;, &lt;matplotlib.axis.XTick object at 0x079E60B0&gt;, &lt;matplotlib.axis.XTick object at 0x079E62F0&gt;], &lt;a list of 5 Text xticklabel objects&gt;)<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_23041\" style=\"width: 572px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/10-1-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-23041\" class=\"wp-image-23041 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/10-1-1.png\" alt=\"Python Histogram\" width=\"562\" height=\"432\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/10-1-1.png 562w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/10-1-1-150x115.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/10-1-1-300x231.png 300w\" sizes=\"auto, (max-width: 562px) 100vw, 562px\" \/><\/a><p id=\"caption-attachment-23041\" class=\"wp-caption-text\">Example of Python Bar Plot<\/p><\/div>\n<h4><strong>b. Setting a Different Color for Each Bar<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">Let\u2019s try five different colors for the bars.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.bar(y,marks,color=['cyan','skyblue','lightpink','brown','black'])<\/pre>\n<p><strong>&lt;BarContainer object of 5 artists&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.xticks(y,bars)<\/pre>\n<p><strong>([&lt;matplotlib.axis.XTick object at 0x0947B570&gt;, &lt;matplotlib.axis.XTick object at 0x0947B170&gt;, &lt;matplotlib.axis.XTick object at 0x0946EC90&gt;, &lt;matplotlib.axis.XTick object at 0x094954B0&gt;, &lt;matplotlib.axis.XTick object at 0x09495850&gt;], &lt;a list of 5 Text xticklabel objects&gt;)<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_23042\" style=\"width: 570px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/11-2.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-23042\" class=\"wp-image-23042 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/11-2.png\" alt=\"Python Histogram\" width=\"560\" height=\"426\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/11-2.png 560w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/11-2-150x114.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/11-2-300x228.png 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><p id=\"caption-attachment-23042\" class=\"wp-caption-text\">Python Bar Chart &#8211; Setting Different Color For Each Bar<\/p><\/div>\n<h4><strong>c. Setting Border Color<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">And now for the border color, \u00a0we use the parameter edgecolor.<\/span><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/data-science-tutorial\/\" target=\"_blank\" rel=\"noopener\">Learn Python Data Science Tutorial<\/a><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.bar(y,marks,color=(0.2,0.4,0.2,0.7),edgecolor='deeppink')<\/pre>\n<p><strong><span style=\"font-family: Verdana, Geneva, sans-serif\">&lt;BarContainer object of 5 artists&gt;<\/span><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.xticks(y,bars)<\/pre>\n<p><strong>([&lt;matplotlib.axis.XTick object at 0x094A7FB0&gt;, &lt;matplotlib.axis.XTick object at 0x094A7BB0&gt;, &lt;matplotlib.axis.XTick object at 0x094A7770&gt;, &lt;matplotlib.axis.XTick object at 0x09426050&gt;, &lt;matplotlib.axis.XTick object at 0x094261F0&gt;], &lt;a list of 5 Text xticklabel objects&gt;)<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_23043\" style=\"width: 577px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/12-1-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-23043\" class=\"wp-image-23043 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/12-1-1.png\" alt=\"Python Histogram\" width=\"567\" height=\"437\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/12-1-1.png 567w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/12-1-1-150x116.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/12-1-1-300x231.png 300w\" sizes=\"auto, (max-width: 567px) 100vw, 567px\" \/><\/a><p id=\"caption-attachment-23043\" class=\"wp-caption-text\">Python Bar Plot &#8211; Setting Border Color<\/p><\/div>\n<h4><strong>d. Horizontal Python Bar Plot<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">How about a horizontal bar Plot?<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.barh(y,marks)<\/pre>\n<p><strong>&lt;BarContainer object of 5 artists&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.yticks(y,bars)<\/pre>\n<p><strong>([&lt;matplotlib.axis.YTick object at 0x084DFC70&gt;, &lt;matplotlib.axis.YTick object at 0x09409B90&gt;, &lt;matplotlib.axis.YTick object at 0x09409CF0&gt;, &lt;matplotlib.axis.YTick object at 0x09413D70&gt;, &lt;matplotlib.axis.YTick object at 0x09413790&gt;], &lt;a list of 5 Text yticklabel objects&gt;)<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_23045\" style=\"width: 593px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/13-1-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-23045\" class=\"wp-image-23045 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/13-1-1.png\" alt=\"Python Histogram\" width=\"583\" height=\"420\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/13-1-1.png 583w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/13-1-1-150x108.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/13-1-1-300x216.png 300w\" sizes=\"auto, (max-width: 583px) 100vw, 583px\" \/><\/a><p id=\"caption-attachment-23045\" class=\"wp-caption-text\">Horizontal Python Bar Plot<\/p><\/div>\n<h4><strong>e. Adding Title and Axis Labels<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">Let\u2019s call it the Sample graph, with roll numbers on the x-axis and marks on the y-axis.<\/span><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/python-interpreter\/\" target=\"_blank\" rel=\"noopener\">Do you know Python Interpreter environment<\/a><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.bar(y,marks,color=(0.5,0.1,0.5,0.6))<\/pre>\n<p><strong>&lt;BarContainer object of 5 artists&gt;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.title('Sample graph')<\/pre>\n<p><strong>Text(0.5,1,&#8217;Sample graph&#8217;)<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.xlabel('Roll numbers')<\/pre>\n<p><strong>Text(0.5,0,&#8217;Roll numbers&#8217;)<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.ylabel('Marks')<\/pre>\n<p><strong>Text(0,0.5,&#8217;Marks&#8217;)<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.ylim(0,100)<\/pre>\n<p><strong>(0, 100)<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.xticks(y,bars)<\/pre>\n<p><strong>([&lt;matplotlib.axis.XTick object at 0x07E991F0&gt;, &lt;matplotlib.axis.XTick object at 0x07E99FD0&gt;, &lt;matplotlib.axis.XTick object at 0x07E999F0&gt;, &lt;matplotlib.axis.XTick object at 0x07E5B1B0&gt;, &lt;matplotlib.axis.XTick object at 0x07DF2CF0&gt;], &lt;a list of 5 Text xticklabel objects&gt;)<\/strong><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/python-data-file-formats\/\" target=\"_blank\" rel=\"noopener\">Let&#8217;s discuss Python Data File Formats<\/a><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; plt.show()<\/pre>\n<div id=\"attachment_23046\" style=\"width: 599px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/14-1-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-23046\" class=\"wp-image-23046 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/14-1-1.png\" alt=\"Python Histogram\" width=\"589\" height=\"451\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/14-1-1.png 589w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/14-1-1-150x115.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/14-1-1-300x230.png 300w\" sizes=\"auto, (max-width: 589px) 100vw, 589px\" \/><\/a><p id=\"caption-attachment-23046\" class=\"wp-caption-text\">Adding Title and Axis Labels in Python Bar Plot<\/p><\/div>\n<p>So, this was all in Python Histogram and Bar Plot using the Matplotlib library. Hope you like our explanation.<\/p>\n<h3><strong>Conclusion<\/strong><\/h3>\n<p>Histograms are used to show the distribution of a single numeric variable. They divide the data into bins and count the number of observations in each bin. This makes it easy to identify skewness, normality, and outliers in your data. Python\u2019s hist() function from Matplotlib or the distplot() from Seaborn are commonly used for this purpose. You can also adjust bin sizes and colors to make the plot more informative and visually appealing.<\/p>\n<p><span style=\"font-weight: 400\">Hence, in this Python Histogram tutorial, we conclude two important topics with plotting- histograms and bar plots in Python. While they seem similar, they\u2019re two different things. Moreover, we discussed an example of a Histogram in Python and a Python bar Plotting example. Still, if any doubt regarding the Python Bar Plot, ask in the comments tab.\u00a0<\/span><br \/>\n<a href=\"https:\/\/matplotlib.org\/\"><strong>For example<\/strong><\/a><span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:1552,&quot;href&quot;:&quot;https:\\\/\\\/matplotlib.org&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251208120224\\\/https:\\\/\\\/matplotlib.org\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-09 10:58:46&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-12 11:17:46&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-19 03:24:32&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-30 13:40:49&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-10 06:09:09&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-21 03:38:51&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-24 18:05:12&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-30 17:38:06&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-09 19:58:35&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-20 09:35:34&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-24 07:44:20&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-28 13:17:36&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-07 16:20:44&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-17 09:28:07&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-02 05:26:27&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-14 02:07:07&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-20 15:23:43&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-24 13:39:06&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-29 04:39:21&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-05 16:43:01&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-11 11:30:34&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-14 13:53:08&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-21 17:13:20&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-03 15:15:51&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-06 17:10:13&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-12 03:30:25&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-12 03:30:25&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, we will see how we can create a Python Histogram and a Python Bar Plot using Matplotlib and Seaborn Python libraries. Moreover, in this Python Histogram and Bar Plotting Tutorial, we will understand&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":23078,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[3979,4318,4320,5648,8004,8602,8603,10383,10584,10676,10826,11655],"class_list":["post-23022","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-displaying-histogram","tag-example-of-python-bar-plots","tag-example-of-python-histogram","tag-histogram-in-python","tag-kernel-density","tag-matplotlib-bar-chart-example","tag-matplotlib-histogram-example","tag-python-bar-plots","tag-python-histogram","tag-python-matplotlib","tag-python-seaborn","tag-rug"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python Histogram | Python Bar Plot (Matplotlib &amp; Seaborn) - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn to Create Python Histogram with Example, Create Python Bar Plot with Example, using matplotlib, using Seaborn, matplotlib bar chart\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/python-histogram-python-bar\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Histogram | Python Bar Plot (Matplotlib &amp; Seaborn) - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn to Create Python Histogram with Example, Create Python Bar Plot with Example, using matplotlib, using Seaborn, matplotlib bar chart\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/python-histogram-python-bar\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-07-27T04:00:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-29T07:15:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Histogram-Python-Bar-01-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Histogram | Python Bar Plot (Matplotlib &amp; Seaborn) - DataFlair","description":"Learn to Create Python Histogram with Example, Create Python Bar Plot with Example, using matplotlib, using Seaborn, matplotlib bar chart","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:\/\/data-flair.training\/blogs\/python-histogram-python-bar\/","og_locale":"en_US","og_type":"article","og_title":"Python Histogram | Python Bar Plot (Matplotlib &amp; Seaborn) - DataFlair","og_description":"Learn to Create Python Histogram with Example, Create Python Bar Plot with Example, using matplotlib, using Seaborn, matplotlib bar chart","og_url":"https:\/\/data-flair.training\/blogs\/python-histogram-python-bar\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-07-27T04:00:16+00:00","article_modified_time":"2026-04-29T07:15:22+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Histogram-Python-Bar-01-1.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/python-histogram-python-bar\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/python-histogram-python-bar\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Python Histogram | Python Bar Plot (Matplotlib &amp; Seaborn)","datePublished":"2018-07-27T04:00:16+00:00","dateModified":"2026-04-29T07:15:22+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-histogram-python-bar\/"},"wordCount":1217,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-histogram-python-bar\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Histogram-Python-Bar-01-1.jpg","keywords":["Displaying Histogram","Example of Python Bar Plots","Example of Python Histogram","Histogram in Python","kernel density","Matplotlib Bar Chart Example","Matplotlib Histogram Example","Python bar Plots","Python Histogram","Python matplotlib","Python seaborn","Rug"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/python-histogram-python-bar\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/python-histogram-python-bar\/","url":"https:\/\/data-flair.training\/blogs\/python-histogram-python-bar\/","name":"Python Histogram | Python Bar Plot (Matplotlib &amp; Seaborn) - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-histogram-python-bar\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-histogram-python-bar\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Histogram-Python-Bar-01-1.jpg","datePublished":"2018-07-27T04:00:16+00:00","dateModified":"2026-04-29T07:15:22+00:00","description":"Learn to Create Python Histogram with Example, Create Python Bar Plot with Example, using matplotlib, using Seaborn, matplotlib bar chart","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/python-histogram-python-bar\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/python-histogram-python-bar\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/python-histogram-python-bar\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Histogram-Python-Bar-01-1.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Python-Histogram-Python-Bar-01-1.jpg","width":1200,"height":628,"caption":"Python Histogram | Python Bar Plot (Matplotlib &amp; Seaborn)"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/python-histogram-python-bar\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Python Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/python\/"},{"@type":"ListItem","position":3,"name":"Python Histogram | Python Bar Plot (Matplotlib &amp; Seaborn)"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/23022","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=23022"}],"version-history":[{"count":8,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/23022\/revisions"}],"predecessor-version":[{"id":148072,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/23022\/revisions\/148072"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/23078"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=23022"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=23022"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=23022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}