<?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"><channel><title><![CDATA[Untitled Publication]]></title><description><![CDATA[Untitled Publication]]></description><link>https://mainamwangiy.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 15:03:55 GMT</lastBuildDate><atom:link href="https://mainamwangiy.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Getting valuable insights from TMDb Movie Dataset.]]></title><description><![CDATA[I have had an amazing opportunity to participate in a Nanodegree in Udacity in the past month and I want to share my interesting journey. I am an aspiring data analyst and in this blog, I will share my first project for investigating the TMDb movie d...]]></description><link>https://mainamwangiy.hashnode.dev/getting-valuable-insights-from-tmdb-movie-dataset</link><guid isPermaLink="true">https://mainamwangiy.hashnode.dev/getting-valuable-insights-from-tmdb-movie-dataset</guid><category><![CDATA[data analysis]]></category><category><![CDATA[Python]]></category><category><![CDATA[Technical writing ]]></category><category><![CDATA[Movies]]></category><category><![CDATA[Data Science]]></category><dc:creator><![CDATA[Maina Mwangi]]></dc:creator><pubDate>Wed, 08 Jun 2022 09:30:03 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1654683018179/5PPdDDEPz.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I have had an amazing opportunity to participate in a <a target="_blank" href="https://www.alx-t.com/courses/data-analyst/">Nanodegree in Udacity</a> in the past month and I want to share my interesting journey. I am an aspiring data analyst and in this blog, I will share my first project for investigating the TMDb movie dataset.</p>
<h1 id="heading-project-investigate-the-movies-dataset">Project: Investigate the Movies Dataset</h1>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ul>
<li><a href="#intro">Introduction</a></li>
<li><a href="#wrangling">Data Wrangling</a></li>
<li><a href="#eda">Exploratory Data Analysis</a></li>
<li><a href="#conclusions">Conclusions</a></li>
</ul>

<p><a id="intro"></a></p>
<h2 id="heading-introduction">Introduction</h2>
<blockquote>
<p>This dataset is dowanloaded from kaggle.com. It is the Movies dataset. It contains information about over 10000 movies that are collected from The Movie Database (TMDb). The dataset includes the movie title, directors, cast, among others. Some of the columns like cast, keywords, and genres contains multiple values and separated by pipe (|) characters. 
The following are the questions I ask myself for this analysis.</p>
<p>### </p>
<ul>
<li>Research Question 1 (Which movie genre is the most popular?)</li>
<li>Research Question 2 (Who is the most common director for movies?) </li>
<li>Research Question 3 (Which are the most common keywords?) </li>
<li>Research Question 4 (Which production companies produce the most movies?) </li>
<li> Research Question 5 (Which is the most common tagline?) </li>
</ul>


</blockquote>
<pre><code class="lang-python"><span class="hljs-comment"># Use this cell to set up import statements for all of the packages that you</span>
<span class="hljs-comment">#   plan to use.</span>
<span class="hljs-comment"># Importing required libraries</span>
<span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">import</span> matplotlib.pyplot <span class="hljs-keyword">as</span> plt
<span class="hljs-keyword">from</span> collections <span class="hljs-keyword">import</span> Counter
%matplotlib inline
</code></pre>
<p><a id="wrangling"></a></p>
<h2 id="heading-data-wrangling">Data Wrangling</h2>
<blockquote>
<p>This step will involve loading the dataset, cleaning the dataset and trimming it. </p>
</blockquote>
<h3 id="heading-general-properties">General Properties</h3>
<pre><code class="lang-python"><span class="hljs-comment"># Load your data and print out a few lines. Perform operations to inspect data</span>
<span class="hljs-comment">#   types and look for instances of missing or possibly errant data.</span>
movies_df = pd.read_csv(<span class="hljs-string">"tmdb-movies.csv"</span>)
movies_df.head(<span class="hljs-number">5</span>)
</code></pre>
<pre><code class="lang-python"><span class="hljs-comment"># Check number of rows and columns</span>
movies_df.shape
</code></pre>
<pre><code><span class="hljs-string">(10866,</span> <span class="hljs-number">21</span><span class="hljs-string">)</span>
</code></pre><pre><code class="lang-python"><span class="hljs-comment"># Describe the data</span>
movies_df.info()
</code></pre>
<pre><code>&lt;<span class="hljs-class"><span class="hljs-keyword">class</span> '<span class="hljs-title">pandas</span>.<span class="hljs-title">core</span>.<span class="hljs-title">frame</span>.<span class="hljs-title">DataFrame</span>'<span class="hljs-title">&gt;</span></span>
<span class="hljs-type">RangeIndex</span>: <span class="hljs-number">10866</span> entries, <span class="hljs-number">0</span> to <span class="hljs-number">10865</span>
<span class="hljs-type">Data</span> columns (total <span class="hljs-number">21</span> columns):
 #   <span class="hljs-type">Column</span>                <span class="hljs-type">Non</span>-<span class="hljs-type">Null</span> <span class="hljs-type">Count</span>  <span class="hljs-type">Dtype</span>  
---  ------                --------------  -----  
 <span class="hljs-number">0</span>   id                    <span class="hljs-number">10866</span> non-<span class="hljs-literal">null</span>  int64  
 <span class="hljs-number">1</span>   imdb_id               <span class="hljs-number">10856</span> non-<span class="hljs-literal">null</span>  <span class="hljs-class"><span class="hljs-keyword">object</span> </span>
 <span class="hljs-number">2</span>   popularity            <span class="hljs-number">10866</span> non-<span class="hljs-literal">null</span>  float64
 <span class="hljs-number">3</span>   budget                <span class="hljs-number">10866</span> non-<span class="hljs-literal">null</span>  int64  
 <span class="hljs-number">4</span>   revenue               <span class="hljs-number">10866</span> non-<span class="hljs-literal">null</span>  int64  
 <span class="hljs-number">5</span>   original_title        <span class="hljs-number">10866</span> non-<span class="hljs-literal">null</span>  <span class="hljs-class"><span class="hljs-keyword">object</span> </span>
 <span class="hljs-number">6</span>   cast                  <span class="hljs-number">10790</span> non-<span class="hljs-literal">null</span>  <span class="hljs-class"><span class="hljs-keyword">object</span> </span>
 <span class="hljs-number">7</span>   homepage              <span class="hljs-number">2936</span> non-<span class="hljs-literal">null</span>   <span class="hljs-class"><span class="hljs-keyword">object</span> </span>
 <span class="hljs-number">8</span>   director              <span class="hljs-number">10822</span> non-<span class="hljs-literal">null</span>  <span class="hljs-class"><span class="hljs-keyword">object</span> </span>
 <span class="hljs-number">9</span>   tagline               <span class="hljs-number">8042</span> non-<span class="hljs-literal">null</span>   <span class="hljs-class"><span class="hljs-keyword">object</span> </span>
 <span class="hljs-number">10</span>  keywords              <span class="hljs-number">9373</span> non-<span class="hljs-literal">null</span>   <span class="hljs-class"><span class="hljs-keyword">object</span> </span>
 <span class="hljs-number">11</span>  overview              <span class="hljs-number">10862</span> non-<span class="hljs-literal">null</span>  <span class="hljs-class"><span class="hljs-keyword">object</span> </span>
 <span class="hljs-number">12</span>  runtime               <span class="hljs-number">10866</span> non-<span class="hljs-literal">null</span>  int64  
 <span class="hljs-number">13</span>  genres                <span class="hljs-number">10843</span> non-<span class="hljs-literal">null</span>  <span class="hljs-class"><span class="hljs-keyword">object</span> </span>
 <span class="hljs-number">14</span>  production_companies  <span class="hljs-number">9836</span> non-<span class="hljs-literal">null</span>   <span class="hljs-class"><span class="hljs-keyword">object</span> </span>
 <span class="hljs-number">15</span>  release_date          <span class="hljs-number">10866</span> non-<span class="hljs-literal">null</span>  <span class="hljs-class"><span class="hljs-keyword">object</span> </span>
 <span class="hljs-number">16</span>  vote_count            <span class="hljs-number">10866</span> non-<span class="hljs-literal">null</span>  int64  
 <span class="hljs-number">17</span>  vote_average          <span class="hljs-number">10866</span> non-<span class="hljs-literal">null</span>  float64
 <span class="hljs-number">18</span>  release_year          <span class="hljs-number">10866</span> non-<span class="hljs-literal">null</span>  int64  
 <span class="hljs-number">19</span>  budget_adj            <span class="hljs-number">10866</span> non-<span class="hljs-literal">null</span>  float64
 <span class="hljs-number">20</span>  revenue_adj           <span class="hljs-number">10866</span> non-<span class="hljs-literal">null</span>  float64
dtypes: float64(<span class="hljs-number">4</span>), int64(<span class="hljs-number">6</span>), <span class="hljs-class"><span class="hljs-keyword">object</span>(<span class="hljs-params">11</span>)</span>
memory usage: <span class="hljs-number">1.7</span>+ <span class="hljs-type">MB</span>
</code></pre><pre><code class="lang-python"><span class="hljs-comment"># Check dataset datatypes</span>
movies_df.dtypes
</code></pre>
<pre><code>id                        int64
imdb_id                  <span class="hljs-class"><span class="hljs-keyword">object</span></span>
popularity              float64
budget                    int64
revenue                   int64
original_title           <span class="hljs-class"><span class="hljs-keyword">object</span></span>
cast                     <span class="hljs-class"><span class="hljs-keyword">object</span></span>
homepage                 <span class="hljs-class"><span class="hljs-keyword">object</span></span>
director                 <span class="hljs-class"><span class="hljs-keyword">object</span></span>
tagline                  <span class="hljs-class"><span class="hljs-keyword">object</span></span>
keywords                 <span class="hljs-class"><span class="hljs-keyword">object</span></span>
overview                 <span class="hljs-class"><span class="hljs-keyword">object</span></span>
runtime                   int64
genres                   <span class="hljs-class"><span class="hljs-keyword">object</span></span>
production_companies     <span class="hljs-class"><span class="hljs-keyword">object</span></span>
release_date             <span class="hljs-class"><span class="hljs-keyword">object</span></span>
vote_count                int64
vote_average            float64
release_year              int64
budget_adj              float64
revenue_adj             float64
dtype: <span class="hljs-class"><span class="hljs-keyword">object</span></span>
</code></pre><h3 id="heading-cleaning-the-data">Cleaning the data</h3>
<blockquote>
<p>Here, we first drop all duplicates present in the dataset. </p>
<p>The next step involves checking the number of null values present in each column. After determining the null values, we then drop them all and check the dataset for any other null or missing values. </p>
</blockquote>
<pre><code class="lang-python"><span class="hljs-comment"># Drop all duplicate values. </span>
movies_df.drop_duplicates(inplace=<span class="hljs-literal">True</span>)
</code></pre>
<pre><code class="lang-python"><span class="hljs-comment"># Check all null and missing values</span>
movies_df.isnull().sum()
</code></pre>
<pre><code><span class="hljs-attribute">id</span>                         <span class="hljs-number">0</span>
<span class="hljs-attribute">imdb_id</span>                   <span class="hljs-number">10</span>
<span class="hljs-attribute">popularity</span>                 <span class="hljs-number">0</span>
<span class="hljs-attribute">budget</span>                     <span class="hljs-number">0</span>
<span class="hljs-attribute">revenue</span>                    <span class="hljs-number">0</span>
<span class="hljs-attribute">original_title</span>             <span class="hljs-number">0</span>
<span class="hljs-attribute">cast</span>                      <span class="hljs-number">76</span>
<span class="hljs-attribute">homepage</span>                <span class="hljs-number">7929</span>
<span class="hljs-attribute">director</span>                  <span class="hljs-number">44</span>
<span class="hljs-attribute">tagline</span>                 <span class="hljs-number">2824</span>
<span class="hljs-attribute">keywords</span>                <span class="hljs-number">1493</span>
<span class="hljs-attribute">overview</span>                   <span class="hljs-number">4</span>
<span class="hljs-attribute">runtime</span>                    <span class="hljs-number">0</span>
<span class="hljs-attribute">genres</span>                    <span class="hljs-number">23</span>
<span class="hljs-attribute">production_companies</span>    <span class="hljs-number">1030</span>
<span class="hljs-attribute">release_date</span>               <span class="hljs-number">0</span>
<span class="hljs-attribute">vote_count</span>                 <span class="hljs-number">0</span>
<span class="hljs-attribute">vote_average</span>               <span class="hljs-number">0</span>
<span class="hljs-attribute">release_year</span>               <span class="hljs-number">0</span>
<span class="hljs-attribute">budget_adj</span>                 <span class="hljs-number">0</span>
<span class="hljs-attribute">revenue_adj</span>                <span class="hljs-number">0</span>
<span class="hljs-attribute">dtype</span>: int<span class="hljs-number">64</span>
</code></pre><pre><code class="lang-python"><span class="hljs-comment"># Remove and drop all null values and missing values</span>
movies_df = movies_df.dropna(subset=[<span class="hljs-string">'imdb_id'</span>,<span class="hljs-string">'cast'</span>,<span class="hljs-string">'homepage'</span>,<span class="hljs-string">'director'</span>,<span class="hljs-string">'tagline'</span>,<span class="hljs-string">'keywords'</span>,<span class="hljs-string">'overview'</span>,<span class="hljs-string">'genres'</span>,<span class="hljs-string">'production_companies'</span>])
</code></pre>
<pre><code class="lang-python"><span class="hljs-comment"># Check again to confirm all the missing and null values have been droppped. </span>
movies_df.isnull().sum()
</code></pre>
<pre><code><span class="hljs-attribute">id</span>                      <span class="hljs-number">0</span>
<span class="hljs-attribute">imdb_id</span>                 <span class="hljs-number">0</span>
<span class="hljs-attribute">popularity</span>              <span class="hljs-number">0</span>
<span class="hljs-attribute">budget</span>                  <span class="hljs-number">0</span>
<span class="hljs-attribute">revenue</span>                 <span class="hljs-number">0</span>
<span class="hljs-attribute">original_title</span>          <span class="hljs-number">0</span>
<span class="hljs-attribute">cast</span>                    <span class="hljs-number">0</span>
<span class="hljs-attribute">homepage</span>                <span class="hljs-number">0</span>
<span class="hljs-attribute">director</span>                <span class="hljs-number">0</span>
<span class="hljs-attribute">tagline</span>                 <span class="hljs-number">0</span>
<span class="hljs-attribute">keywords</span>                <span class="hljs-number">0</span>
<span class="hljs-attribute">overview</span>                <span class="hljs-number">0</span>
<span class="hljs-attribute">runtime</span>                 <span class="hljs-number">0</span>
<span class="hljs-attribute">genres</span>                  <span class="hljs-number">0</span>
<span class="hljs-attribute">production_companies</span>    <span class="hljs-number">0</span>
<span class="hljs-attribute">release_date</span>            <span class="hljs-number">0</span>
<span class="hljs-attribute">vote_count</span>              <span class="hljs-number">0</span>
<span class="hljs-attribute">vote_average</span>            <span class="hljs-number">0</span>
<span class="hljs-attribute">release_year</span>            <span class="hljs-number">0</span>
<span class="hljs-attribute">budget_adj</span>              <span class="hljs-number">0</span>
<span class="hljs-attribute">revenue_adj</span>             <span class="hljs-number">0</span>
<span class="hljs-attribute">dtype</span>: int<span class="hljs-number">64</span>
</code></pre><p><a id="eda"></a></p>
<h2 id="heading-exploratory-data-analysis">Exploratory Data Analysis</h2>
<h3 id="heading-research-question-1-which-movie-genre-is-the-most-popular">Research Question 1 (Which movie genre is the most popular?)</h3>
<pre><code class="lang-python"><span class="hljs-comment"># Function to count the top 15 most common in the dataset</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">counting</span>(<span class="hljs-params">param</span>):</span>
    counter = Counter()
    <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> param:
        counter[i] += <span class="hljs-number">1</span>
    top15_most_common = counter.most_common(<span class="hljs-number">15</span>)
    <span class="hljs-keyword">return</span> top15_most_common
</code></pre>
<pre><code class="lang-python"><span class="hljs-comment"># Continue to explore the data to address your additional research</span>
<span class="hljs-comment">#   questions. Add more headers as needed if you have more questions to</span>
<span class="hljs-comment">#   investigate.</span>
genres = <span class="hljs-string">"|"</span>.join(movies_df[<span class="hljs-string">'genres'</span>]).split(<span class="hljs-string">"|"</span>)

top15_most_common_genres = counting(genres)


genres_df = pd.DataFrame (top15_most_common_genres, columns = [<span class="hljs-string">'genres'</span>,<span class="hljs-string">'Genres Count'</span>])
genres_df.sort_values(ascending=<span class="hljs-literal">True</span>, by=<span class="hljs-string">'Genres Count'</span>, inplace=<span class="hljs-literal">True</span>)
ax = genres_df.plot.barh(x=<span class="hljs-string">'genres'</span>,color=[<span class="hljs-string">"#FF69B4"</span>,<span class="hljs-string">"#F0F8FF"</span>],width=<span class="hljs-number">0.7</span>,legend=<span class="hljs-literal">False</span>, figsize=(<span class="hljs-number">10</span>, <span class="hljs-number">10</span>), title=<span class="hljs-string">"A bar plot to find the most common genre of the movies"</span>)
ax.set_ylabel(<span class="hljs-string">"Genres"</span>)
ax.set_xlabel(<span class="hljs-string">"Genres counts"</span>)
</code></pre>
<pre><code><span class="hljs-attribute">Text</span>(<span class="hljs-number">0</span>.<span class="hljs-number">5</span>, <span class="hljs-number">0</span>, 'Genres counts')
</code></pre><p>![A bar plot to find the most common genre of the movies](
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1654679982823/mp35W0BsV.png" alt="output_15_1.png" /></p>
<blockquote>
<p>This bar chart is used to analyze the most common genrein this movie dataset. The analysis is done for the top 15 most common genres with their number of counts in the dataset. It is clear that most of the movies produced directed are in the Drama Genre type. This is followed by Comedy, Thriller, Action and Adventure movies. It measn that these are the most watched movies. </p>
</blockquote>
<h3 id="heading-research-question-2-who-is-the-most-common-director-for-movies">Research Question 2  (Who is the most common director for movies?)</h3>
<pre><code class="lang-python">director = <span class="hljs-string">"|"</span>.join(movies_df[<span class="hljs-string">'director'</span>]).split(<span class="hljs-string">"|"</span>)

top15_most_common_directors = counting(director) 

director_df = pd.DataFrame (top15_most_common_directors, columns = [<span class="hljs-string">'director'</span>,<span class="hljs-string">'Directors'</span>])
director_df.sort_values(ascending=<span class="hljs-literal">False</span>, by=<span class="hljs-string">'Directors'</span>, inplace=<span class="hljs-literal">True</span>)
ax = director_df.plot.bar(x=<span class="hljs-string">'director'</span>,color=[<span class="hljs-string">"#746AB0"</span>],width=<span class="hljs-number">0.7</span>,legend=<span class="hljs-literal">False</span>, figsize=(<span class="hljs-number">10</span>, <span class="hljs-number">10</span>), title=<span class="hljs-string">"A bar plot to find the director who produced the most movies. "</span>)
ax.set(xlabel=<span class="hljs-string">"Directors"</span>, ylabel=<span class="hljs-string">"Directors counts"</span>)
</code></pre>
<pre><code>[Text(<span class="hljs-number">0.5</span>, <span class="hljs-number">0</span>, 'Directors'), Text(<span class="hljs-number">0</span>, <span class="hljs-number">0.5</span>, 'Directors counts')]
</code></pre><p>![A bar plot to find the director who produced the most movies.](
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1654680012744/YCSU5f4ap.png" alt="output_18_1.png" /></p>
<blockquote>
<p>In research question two, I went further to investigate which director had produced the most movies from this dataset. I did that by finding the most common director by ther counts. I picked the top 15 most common to make the plot as shown above. I found out that John Carpenter was the most common director. Hence, John Carpenter was the director who had produced the most moves. </p>
</blockquote>
<h3 id="heading-research-question-3-which-are-the-most-common-keywords">Research Question 3  (Which are the most common keywords?)</h3>
<pre><code class="lang-python">keywords = <span class="hljs-string">"|"</span>.join(movies_df[<span class="hljs-string">'keywords'</span>]).split(<span class="hljs-string">"|"</span>)
keywords

top15_most_common_keywords = counting(keywords) 

keywords_df = pd.DataFrame (top15_most_common_keywords, columns = [<span class="hljs-string">'keywords'</span>,<span class="hljs-string">'Keywords'</span>])
keywords_df.sort_values(ascending=<span class="hljs-literal">True</span>, by=<span class="hljs-string">'Keywords'</span>, inplace=<span class="hljs-literal">True</span>)
keywords_df.plot.barh(x=<span class="hljs-string">'keywords'</span>,color=[<span class="hljs-string">"#FFCE30"</span>],width=<span class="hljs-number">0.7</span>,legend=<span class="hljs-literal">False</span>, figsize=(<span class="hljs-number">10</span>, <span class="hljs-number">10</span>),xlabel=<span class="hljs-string">"Keywords"</span>, ylabel=<span class="hljs-string">"keyword counts"</span>, title=<span class="hljs-string">"A bar plot to find the most common used keyword in naming movies."</span>)
</code></pre>
<pre><code><span class="hljs-operator">&lt;</span>AxesSubplot:title<span class="hljs-operator">=</span>{<span class="hljs-string">'center'</span>:<span class="hljs-string">'A bar plot to find the most common used keyword in naming movies.'</span>}, ylabel<span class="hljs-operator">=</span><span class="hljs-string">'Keywords'</span><span class="hljs-operator">&gt;</span>
</code></pre><p>![A bar plot to find the most commonly used keyword in naming movies.](
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1654680050946/mA2LEK6-E.png" alt="output_21_1.png" /></p>
<blockquote>
<p>I went further to find out which keyword was the most used in the movies. I was able to find this by analyzing the dataset for the most common top 15 keywords used by their counts. I found out that based on the novel was the most used and most common keyword. </p>
</blockquote>
<h3 id="heading-research-question-4-which-production-companies-produce-the-most-movies">Research Question 4 (Which production companies produce the most movies?)</h3>
<pre><code class="lang-python">movies_df[<span class="hljs-string">'production_companies'</span>].value_counts()[:<span class="hljs-number">15</span>].plot(kind=<span class="hljs-string">'pie'</span>,figsize=(<span class="hljs-number">10</span>,<span class="hljs-number">10</span>))
</code></pre>
<pre><code><span class="hljs-operator">&lt;</span>AxesSubplot:ylabel<span class="hljs-operator">=</span><span class="hljs-string">'production_companies'</span><span class="hljs-operator">&gt;</span>
</code></pre><p>![png](
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1654680074712/6ymr4Rnye.png" alt="output_24_1.png" /></p>
<blockquote>
<p>I investigated the production company that produces the most movies. I did that by plotting a pie char of the top 10 production companies with their counts. I found out that Walt Disney Pictures produced the most movies. </p>
</blockquote>
<h3 id="heading-research-question-5-which-is-the-most-common-tagline">Research Question 5 (Which is the most common tagline?)</h3>
<pre><code class="lang-python">movies_df[<span class="hljs-string">'tagline'</span>].value_counts()[:<span class="hljs-number">10</span>].plot(kind=<span class="hljs-string">'pie'</span>,figsize=(<span class="hljs-number">10</span>,<span class="hljs-number">10</span>))
</code></pre>
<pre><code><span class="hljs-operator">&lt;</span>AxesSubplot:ylabel<span class="hljs-operator">=</span><span class="hljs-string">'tagline'</span><span class="hljs-operator">&gt;</span>
</code></pre><p>![png](
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1654680089879/R_hTGvwqW.png" alt="output_27_1.png" /></p>
<pre><code class="lang-python"><span class="hljs-comment"># Length of movies with budget</span>
plt.hist(movies_df.budget[movies_df.runtime &gt; <span class="hljs-number">100</span>], <span class="hljs-number">25</span>, facecolor=<span class="hljs-string">"b"</span>, alpha=<span class="hljs-number">1</span>,label=<span class="hljs-string">"long movies"</span>)
plt.hist(movies_df.budget[movies_df.runtime &lt; <span class="hljs-number">100</span>], <span class="hljs-number">25</span>, facecolor=<span class="hljs-string">"g"</span>, alpha=<span class="hljs-number">0.75</span>,label=<span class="hljs-string">"short movies"</span>)
plt.legend()
plt.xlabel(<span class="hljs-string">'Budget'</span>)
plt.ylabel(<span class="hljs-string">'Runtime Hours'</span>)
plt.title(<span class="hljs-string">'Histogam'</span>)
plt.grid(<span class="hljs-literal">True</span>)
</code></pre>
<p>![png](
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1654680102513/T2O4qzoTb.png" alt="output_28_0.png" /></p>
<p><a id="conclusions"></a></p>
<h2 id="heading-conclusions">Conclusions</h2>
<blockquote>
<p>In the first section, I analyzed the most common genre of the movies. From the analysis, I can conclude that the top 5 genres were Drama, Comedy, Drama|Romance, Documentary,and Horror|Thriller. In the second secion, the director who directed the most movies was John Carpenter. He was followed by Steven Splelberg, Steven Soderbergh, Ridley Scott, and Robert Zemeckis. These were the most top 5 common directors. In the third section, I wanted to determine which keywords were mostly used to search for movies and the keywords used in the movies. The top 5 keywords used were Woman director, duringcreditsstringer, independent film, biography, and christmas. Further, it wa important to determine which different compnanies are known to produce and direct movies. The top five production companies are Universal Pictures, DreamWorks Animation, Marvel Studios, Walt Disney Pictures|Pixar Animation Studios, and Walt Disney Pictures. Finally, I was able to determine that the most common tagline in this analysis is Two films One love. </p>
</blockquote>
<h2 id="heading-limitations">Limitations</h2>
<blockquote>
<p>In the first section, the type of genres were too many to analyze and come up with a good conclusion from the analysis. Therefore, I only took an analysis of the top 15 most common types of genres. This was the same with the directors and keywords section where I only analyzed the top 15 common directors and keywords respectfully. A pie plot of the production companies also had many results from the analysis with the data points almost the same length. Therefore, I was only able to plot the first 15 production companies to show the relationship. </p>
</blockquote>
<h3 id="heading-references">References.</h3>
<blockquote>
<p>https://www.kaggle.com/code/danielleho/exploratory-analysis-netflix-shows-and-movies</p>
</blockquote>
]]></content:encoded></item></channel></rss>