<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[A Deep Dive Into EDA: Learn Visualization From Most Interesting Pokemon Dataset - Medium]]></title>
        <description><![CDATA[Visualization had never been this fun before, explore some of the most useful techniques that comes very handy in day to day analysis of data. - Medium]]></description>
        <link>https://medium.com/deep-dive-into-exploratory-data-analysis?source=rss----ceea5bda1c41---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>A Deep Dive Into EDA: Learn Visualization From Most Interesting Pokemon Dataset - Medium</title>
            <link>https://medium.com/deep-dive-into-exploratory-data-analysis?source=rss----ceea5bda1c41---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 05:43:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/deep-dive-into-exploratory-data-analysis" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Deep Dive Into EDA]]></title>
            <link>https://medium.com/deep-dive-into-exploratory-data-analysis/eda-pokemon-visualization-58102b68e2d7?source=rss----ceea5bda1c41---4</link>
            <guid isPermaLink="false">https://medium.com/p/58102b68e2d7</guid>
            <category><![CDATA[matplotlib]]></category>
            <category><![CDATA[explore]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[visualization]]></category>
            <dc:creator><![CDATA[Ayush Gupta]]></dc:creator>
            <pubDate>Mon, 22 Jul 2019 18:03:21 GMT</pubDate>
            <atom:updated>2024-05-20T08:31:19.730Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hh-HFAUs4w1nFr78f2aasw.png" /></figure><h3>A Deep Dive Into Exploratory Data Analysis: Pokemon Dataset</h3><h3>Introduction</h3><p>Exploratory data analysis is one of the most important and useful aspects of Data Science and Machine Learning. It is one of the most powerful approaches to analyzing data using various visualization techniques.</p><p>In this article, I have tried to cover some of the most important visualization techniques that are required to understand the data in a better way.</p><p>I have taken one of the most interesting datasets of Pokemon for all those 90s people, but don’t worry if you are not aware of Pokemon, the data set is pretty easy to understand.</p><p>So here we Go!</p><h3>Getting Ready</h3><p>There are many visualization libraries present today in Python which gives amazing graphs and plots, some of these libraries are:</p><ul><li><strong>Matplotlib: </strong>Python’s 2D plotting library</li><li><strong>Seaborn: </strong>Provides a high-level interface</li><li><strong>Plotly: </strong>Creates interactive plots</li><li><strong>Bokeh: </strong>It’s a highly interactive library</li><li><strong>ggplot: </strong>Based on R’s ggplot and the <a href="http://www.amazon.com/Grammar-Graphics-Statistics-Computing/dp/0387245448"><em>Grammar of Graphics</em></a></li></ul><p>In this article, we are going to explore some of the most awesome visualization techniques using <strong>Matplotlib</strong> and <strong>Seaborn</strong>. Visualizing the data is the first step, after visualization, we are going to learn some of the important data manipulation techniques. I’ll be using pandas and numpy frequently, if you want to learn more about this, <a href="https://www.hackerearth.com/practice/machine-learning/data-manipulation-visualisation-r-python/tutorial-data-manipulation-numpy-pandas-python/tutorial/"><em>click here</em></a>.</p><p><strong>Installation</strong></p><pre>#install Matplotlib<br>pip install matplotlib</pre><pre>#install Seaborn<br>pip install seaborn</pre><p><strong>Dataset</strong></p><p>As mentioned above the dataset is of Pokemon, containing 13 attributes for 800 different Pokemon.</p><p><em>Link to Dataset-&gt; </em><a href="https://www.kaggle.com/abcsds/pokemon"><em>https://www.kaggle.com/abcsds/pokemon</em></a></p><p>We will try to see if it could predict the type of Pokemon using other attributes.</p><h3><strong>Getting started</strong></h3><p>Before getting started a few things must be kept in mind:</p><ul><li>Check for Missing Values</li><li>Check for Class Imbalance</li><li>Check for Redundant Attributes</li><li>Check for the distribution of various attributes</li><li>Check for Outliers</li></ul><p><strong>Importing Data</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sAJOCRMeOKxIJcCDXBE5ww.png" /><figcaption>Importing the dataset from CSV file using pandas</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uSEO6UrqCXDh_ZYIkxjuMg.png" /><figcaption>This gives the shape of the data(rows, columns)</figcaption></figure><p><strong>Correcting spelling mistakes</strong></p><p>As you can see the name of the Mega Pokemon are not correct, so correcting the names for mega evolved Pokemon. [ VenusaurMega Venusaur -&gt; Mega Venusaur]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YcWMATIVxc1Ha0xIyEzQyA.png" /><figcaption>Now the names of Mega Evolved are correct</figcaption></figure><p><strong>To check the Missing Values:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KnEsL8ZABXPpBPnnVU-CaA.png" /><figcaption>We can see the Type2 attribute has 386 missing values</figcaption></figure><p>Missing values are a great pain if not dealt with, <a href="https://github.com/ResidentMario/missingno"><strong>missingno</strong></a> module is one of the great ways to visualize the missing values present in the dataset. You can even use the <strong>seaborn heatmap </strong>to plot a beautiful graph depicting all the missing values.</p><blockquote>Read this article “<a href="https://dev.to/tomoyukiaota/visualizing-the-patterns-of-missing-value-occurrence-with-python-46dj"><em>Visualizing the patterns of missing value occurrence with Python</em></a>”on visualising the missing values using the above two approaches.</blockquote><p>What to do next after detecting the missing value?</p><p>We can do the following things once we have found the missing values:</p><ol><li>Remove Rows With Missing Values.</li><li>Choose a Global Value to replace all the missing values from the attribute.</li><li>Use the Mean of the attribute and replace all the missing values with this mean.</li><li>Use the median of the attribute and replace all the missing values with this median.</li><li>There are various predictive models to estimate the value to be filled in.</li></ol><blockquote>You can go to this awesome article for filling of missing value: <a href="https://towardsdatascience.com/how-to-handle-missing-data-8646b18db0d4"><strong><em>How to Handle Missing Data</em></strong></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9D-TJzT2hmL3eTqWu60qRg.png" /><figcaption>Taken from the article “<a href="https://towardsdatascience.com/how-to-handle-missing-data-8646b18db0d4">How to Handle Missing Data</a>”</figcaption></figure><p>Here as the Type2 attribute has 386 missing values, I have just simply put the Type1 values in the Type2 due to the fact that some Pokemon have only 1 type present, and even if there are 2 types, Generally, Pokemon have 1 type stronger than 2 type, so for missing values, this will work.</p><p>For other Datasets, any of the above 5 things can be done to fill in the missing values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7EP3-S0kEubG15SyHUE_tQ.png" /><figcaption>Now there are <strong>no missing values</strong> in the dataset</figcaption></figure><p><strong>Check for class Imbalance</strong></p><p>There are a lot of ways in which you can check for the class imbalance, among those I prefer to use either a Histogram or Pie chart of all the classes present in the target attribute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6z_h0opfijkBl0DxknFz1w.png" /><figcaption>Gives all the <strong>unique values</strong> of the attribute</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AxadxBlE0zw9sw66PHhcsw.png" /><figcaption>Gives counts of all the values in the attribute</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7qVFmQMURkqK_qgeiFSQCA.png" /><figcaption>Plotting the Pie chart using the above data</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*6nlGqkyxUkgvx_bDLpgXCQ.png" /></figure><p>A Pie Chart is one of the ways to represent different classes but a Histogram can be used as well.</p><p>The pie chart count of each class must be known and fed into <em>plt.pie</em> to return the percentage of each class.</p><p><strong>Check for Redundant Attributes:</strong></p><p>Selecting the best features that represent the Dataset has always been the most important step before putting our data in any kind of machine learning model.</p><p>There are various ways of selecting the best features, some of them are:</p><ol><li>Univariate Selection</li><li>Feature Importance</li><li>Correlation Matrix with Heatmap</li></ol><blockquote>You can visit this article “<a href="https://towardsdatascience.com/feature-selection-techniques-in-machine-learning-with-python-f24e7da3f36e">Feature Selection Techniques in Machine Learning with Python</a>” for more information.</blockquote><p>I have used <strong>Heat Map</strong>, which tells the correlation between different attributes. We have to check for Highly correlated attributes in the Heat Map and remove them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wgTIrdzTv83kUrJftMfkVg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QNZI8OnWY3UK1sukRvXPiA.png" /><figcaption>From the scale of 0 being least correlated and 1 being most</figcaption></figure><p>For now, removing the categorical features to analyze the non-categorical data effect on Type1 and Type2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VEwtvBw5aZCUT0yn1gXYeA.png" /><figcaption>new_Data is a copy of the daily_Data dataset, ‘Generation’ and ‘Legendary’ are removed for now</figcaption></figure><h4><strong>Check for Outliers</strong></h4><p><strong>Box plots</strong> are a great way to depict the attributes, they show quartile ranges and Outliers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x8IPgKDvQNmuac13BSpPNw.png" /></figure><p><strong>BoxPlots:</strong></p><p><strong>Median (Q2/50th Percentile)</strong>: the middle value of the dataset.<strong>First quartile (Q1/25th Percentile): the middle number between the smallest number and the median of the dataset.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BvnhVVCb6qOHRvpE8pNv0w.png" /></figure><p><strong>Third quartile (Q3/75th Percentile)</strong>: the middle value between the median and the highest value of the dataset.<strong>Interquartile range (IQR): 25th to the 75th percentile.whiskers (shown in blue)Outliers (shown as green circles)</strong>“<strong>maximum</strong>”: Q3 + 1.5*IQR“<strong>minimum</strong>”: Q1 -1.5*IQR</p><blockquote>Refer to this article “<a href="https://towardsdatascience.com/understanding-boxplots-5e2df7bcbd51">Understanding Boxplots</a>” to know more about boxplots.</blockquote><h3>Visualizing different attributes</h3><p><strong>Strip-plot</strong>,<strong> Box-plot </strong>and<strong> Bar-plots,</strong> <strong>Swarm-plots</strong>, <strong>Factor-plots, </strong>and<strong> Radar Chart </strong>are a great way to Visualise various attributes in the dataset.</p><p>The function takes <strong>Type1 or Type2(Target)</strong> and draws a strip plot and box plot corresponding to the <strong>attribute</strong> selected in the function, moreover a box plot is also drawn using the mean of the taken <strong>attribute</strong> grouped by <strong>Type1 or Type2(Target).</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ib1CDK8-u1CYVjh1YS3HsQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hJgx_iAnUN6mKW68LGQzFw.png" /><figcaption>Function mean_attribute can be called for each attribute(other Non categorical)and Type1/Type2(Target)</figcaption></figure><p>Checking the Categorical Attributes: ‘<strong>Generation</strong>’ and ‘<strong>Legendary</strong>’ attributes effects on Dataset.</p><p><a href="https://seaborn.pydata.org/generated/seaborn.swarmplot.html"><strong>Swarm plots</strong></a></p><p>They can be drawn on its own, but it is also a good complement to a <strong>box</strong> or <strong>violin</strong> <strong>plot</strong> in cases where you want to show all observations along with some representation of the underlying distribution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RWceU1Q8Hj829uJQB3K2Uw.png" /></figure><p>Further,we have to see how the number of pokemon of each <strong>type</strong> depend on <strong>generation</strong> as seen below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JN1lHhydMmDcONPDA4kyjA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gLJyW1uooCgTrjtYI6OcFA.png" /></figure><p>We have seen how the <strong>Types</strong> of Pokemon are related to <strong>Generation </strong>and how each generation of Pokemon contributes to different attributes in a swarm plot.</p><p>Now we will see the effect of <strong>Legendary</strong> on the different attributes, I have used <strong>Factor-Plot </strong>to clearly differentiate between Legendary and Non-Legendary Pokemon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_K6k__s8Oy4gvtVsO3srjg.png" /><figcaption>Swarm kind of factor plot</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i7xZRNapdeIbRfYmktR0Ag.png" /><figcaption>Bar kind of factor plot</figcaption></figure><p>We can see from the above plot that <strong>Legendary</strong> Pokemon(<strong>orange</strong>) have a higher Total than the <strong>Non-Legendary</strong> Pokemon(<strong>Blue</strong>).</p><p><strong>Comparison of Different Pokemon</strong></p><ul><li><strong>Bar-plot</strong> for each attribute for comparison of two different Pokemon</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lvRThEZ9enGdmbkLc4MSPg.png" /></figure><ul><li><strong>Radar chart</strong> for comparison of two different Pokemon</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vEvxqCtyKueXEU8A61fcCQ.png" /></figure><pre><strong>#Code for Radar Chart</strong></pre><pre>pok1=daily_Data.loc[pokemon1]<br>pok2=daily_Data.loc[pokemon2]<br># Libraries<br>import matplotlib.pyplot as plt<br>import pandas as pd<br>from math import pi<br>fig = plt.figure(figsize=(10, 10))<br># Set data<br>df = pd.DataFrame({<br>&#39;group&#39;: [&#39;A&#39;,&#39;B&#39;],<br>&#39;HP&#39;: [pok1[&quot;HP&quot;], pok2[&quot;HP&quot;]],<br>&#39;Attack&#39;: [pok1[&quot;Attack&quot;], pok2[&quot;Attack&quot;]],<br>&#39;Defense&#39;: [pok1[&quot;Defense&quot;], pok2[&quot;Defense&quot;]],<br>&#39;Sp. Atk&#39;: [pok1[&quot;Sp. Atk&quot;], pok2[&quot;Sp. Atk&quot;]],<br>&#39;Sp. Def&#39;: [pok1[&quot;Sp. Def&quot;], pok2[&quot;Sp. Def&quot;]],<br>&#39;Speed&#39;: [pok1[&quot;Speed&quot;], pok2[&quot;Speed&quot;]]<br>})</pre><pre>#maximum among all<br>maximum=max([pok1[&quot;Attack&quot;], pok2[&quot;Attack&quot;],pok1[&quot;Defense&quot;], pok2[&quot;Defense&quot;],pok1[&quot;Sp. Atk&quot;], pok2[&quot;Sp. Atk&quot;],<br>pok1[&quot;Sp. Def&quot;], pok2[&quot;Sp. Def&quot;],pok1[&quot;Speed&quot;], pok2[&quot;Speed&quot;]])<br> <br># ------- PART 1: Create background<br> <br># number of variable<br>categories=[&#39;HP&#39;, &#39;Attack&#39;, &#39;Defense&#39;, &#39;Sp. Atk&#39;,<br>       &#39;Sp. Def&#39;, &#39;Speed&#39;]<br>N = len(categories)<br>#to select the range, means till where the graph can go for a variable.<br>aa=[]<br>aaa=[]<br>for i in range(maximum):<br>    aa.append(i*10)<br>    aaa.append(str(i*10))</pre><pre># What will be the angle of each axis in the plot? (we divide the plot / number of variable)<br>angles = [n / float(N) * 2 * pi for n in range(N)]<br>angles += angles[:1]<br> <br># Initialise the spider plot<br>ax = plt.subplot(111, polar=True)<br> <br># If you want the first axis to be on top:<br>ax.set_theta_offset(pi / 2)<br>ax.set_theta_direction(-1)<br> <br># Draw one axe per variable + add labels labels yet<br>plt.xticks(angles[:-1], categories,size=15,color=&quot;black&quot;)</pre><pre># Draw ylabels<br>ax.set_rlabel_position(0)<br>plt.yticks(aa, aaa, color=&quot;black&quot;, size=15)<br>plt.ylim(0,maximum)</pre><pre># ------- PART 2: Add plots<br> <br># Plot each individual = each line of the data <br># Ind1<br>values=df.loc[0].drop(&#39;group&#39;).values.flatten().tolist()<br>values += values[:1]<br>ax.plot(angles, values, linewidth=4, linestyle=&#39;solid&#39;, label=pokemon1,color=color1)<br>ax.fill(angles, values, color1, alpha=0.1)<br> <br># Ind2<br>values=df.loc[1].drop(&#39;group&#39;).values.flatten().tolist()<br>values += values[:1]<br>ax.plot(angles, values, linewidth=4, linestyle=&#39;solid&#39;, label=pokemon2,color=color2)<br>ax.fill(angles, values, color2, alpha=0.1)<br> <br># Add legend<br>plt.legend(loc=&#39;upper right&#39;, bbox_to_anchor=(0.1, 0.1))</pre><blockquote>Code for entire article can be found on <a href="https://www.kaggle.com/ayush01/complete-pokemon-stats-visualization">https://www.kaggle.com/ayush01/complete-pokemon-stats-visualization</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58102b68e2d7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/deep-dive-into-exploratory-data-analysis/eda-pokemon-visualization-58102b68e2d7">A Deep Dive Into EDA</a> was originally published in <a href="https://medium.com/deep-dive-into-exploratory-data-analysis">A Deep Dive Into EDA: Learn Visualization From Most Interesting Pokemon Dataset</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>