# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load

import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory

import os
for dirname, _, filenames in os.walk('/kaggle/input'):
    for filename in filenames:
        print(os.path.join(dirname, filename))

# You can write up to 5GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using "Save & Run All" 
# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session
"""
![ott1.jpeg](attachment:ott1.jpeg)
"""
"""
# Wanna Binge some movies? Confused? 


# Here 's the solution.


# 


<a id="intro"></a>
<h2>   
    <font  color='red'>
          <span>
            We will get following answers:- :
            </span>   
    </font>
</h2>

(1)  Which OTT platform is the best for IMDB 9+ Movies/Shows

(2)  On which OTT Platforms, Nolan and Russo Brother's movies are available?

(3)  Best Thrillers/ Actions/ Adventure/ Sci-fi Movies and its OTT platform
"""
"""
![upvote.jpg](attachment:upvote.jpg)
"""
"""
<h2>   
      <span>          
           Contents
    </span>
       
</h2>
<span>
    <ul>
        <li><a href='#intro'>1. Introduction</a></li>
        <ul>
            <li><a href='#background'>1.1 Background info</a></li>
            <li><a href='#data'>1.2 Dataset information</a></li>
        </ul>
        <li><a href='#libraries'>2. Python Libraries</a></li>
        <ul>
            <li><a href='#python'>2.1 Import Python Libraries</a></li>
         </ul>
        <li><a href='#understand'>3. Understanding the data</a></li>
        <ul>
            <li><a href='#import'>3.1 Importing the input csv</a></li>
            <li><a href='#inspect'>3.2 Overview the dataframes</a></li>
            <li><a href='#unwanted'>3.3 Observe Null Values</a></li>
            <li><a href='#unwanted'>3.4 Pandas Profiling</a></li>
        </ul>
              <li><a href='#eda'>4. EDA (Exploratory Data Anslysis)</a></li>
        <ul>
            <li><a href='#app_Rating'>4.1 Highest ROtten Tomatoes Movies/Shows</a></li>
            <li><a href='#rating_cate'>4.2 Highest IMDB Rating</a></li>
            <li><a href='#type'>4.3 Top Movies and its OTT Platform</a></li>        
            <li><a href='#type'>4.4 Top Language Movies</a></li>        
            <li><a href='#type'>4.5 Best Christopher Nolan's Movies</a></li>        
            <li><a href='#type'>4.6 Best Russo Brother's Movies</a></li>        
            <li><a href='#type'>4.7 Best Thriller Movies/Shows</a></li>        
            <li><a href='#type'>4.8 Movies/Shows on OTT Platforms</a></li>        
            <li><a href='#type'>4.9 Best Animation Movies/Show</a></li>                       
        </ul>
            <li><a href='#low'>6. Netflix Overview</a></li>
        <ul>
            <li><a href='#low_app'>6.1 Available Languages</a></li>
             <li><a href='#tools'>6.2 Top Runtime movies/shows</a></li>
             <li><a href='#age'>6.3 Top IMDB Movies </a></li>
             <li><a href='#age'>6.4 Top Thriller Movies </a></li>
             <li><a href='#age'>6.5 Top SCIFI Movies </a></li>
             <li><a href='#age'>6.6 Top action Movies </a></li>
             <li><a href='#age'>6.7 Top  animation Movies </a></li> 
        </ul> 
          <li><a href='#low'>7. HULU Overview</a></li>
        <ul>
            <li><a href='#low_app'>7.1 Available Languages</a></li>
             <li><a href='#tools'>7.2 Top Runtime movies/shows</a></li>
             <li><a href='#age'>7.3 Top IMDB Movies </a></li>
             <li><a href='#age'>7.4 Top Thriller Movies </a></li>
             <li><a href='#age'>7.5 Top SCIFI Movies </a></li>
             <li><a href='#age'>7.6 Top action Movies </a></li>
             <li><a href='#age'>7.7 Top  animation Movies </a></li> 
        </ul> 
          <li><a href='#low'>8. Prime Video Overview</a></li>
        <ul>
            <li><a href='#low_app'>8.1 Available Languages</a></li>
             <li><a href='#tools'>8.2 Top Runtime movies/shows</a></li>
             <li><a href='#age'>8.3 Top IMDB Movies </a></li>
             <li><a href='#age'>8.4 Top Thriller Movies </a></li>
             <li><a href='#age'>8.5 Top SCIFI Movies </a></li>
             <li><a href='#age'>8.6 Top action Movies </a></li>
             <li><a href='#age'>8.7 Top  animation Movies </a></li> 
        </ul> 
        <li><a href='#low'>9. Disney+ Overview</a></li>
        <ul>
            <li><a href='#low_app'>9.1 Available Languages</a></li>
             <li><a href='#tools'>9.2 Top Runtime movies/shows</a></li>
             <li><a href='#age'>9.3 Top IMDB Movies </a></li>
             <li><a href='#age'>9.4 Top Thriller Movies </a></li>
             <li><a href='#age'>9.5 Top SCIFI Movies </a></li>
             <li><a href='#age'>9.6 Top action Movies </a></li>
             <li><a href='#age'>9.7 Top  animation Movies </a></li> 
        </ul>          
                <li><a href='#obser'>10. Conclusion</a></li>
                                

"""
"""
<a id="intro"></a>
<h2>   
    <font  color='red'>
          <span>
            1. Introduction :
            </span>   
    </font>
</h2>
"""
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            1.1 Background Information
            </span>   
    </font>
</h3>
"""
"""
Over the last few years, audiences in India have shifted their focus from TV to online streaming platforms. Out of the many platforms Hotstar, Netflix and Amazon Prime Video are currently the most popular ones.

However, this is not the only platform where people can watch unlimited movies and series, we have other OTT platforms that are making a tremendous business including Amazon Prime, Netflix.

On this related note, we have jotted down the features of all the platforms while also breaking down the have’s and have-nots of each. So let’s begin.
"""
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            1.2 Dataset Information :
            </span>   
    </font>
</h3>
"""
"""
 
* ID:  Movie ID

* Title: Movie Title

* Year: Release Year

* Age: Age restriction

* IMDB: IMDB Rating

* ROttern Tomatoes: Tomatoes Rating

* Netflix, Hulu,Prime Video, Disney+ : OTT Platforms

* Type: Movie Genres

* DIrectors: Movie Director

![](http://)* Country: Release in Country
"""
"""
<a id="intro"></a>
<h2>   
    <font  color='red'>
          <span>
            2. Python Libraries :
            </span>   
    </font>
</h2>
"""
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            2.1: Import Python Libraries
            </span>   
    </font>
</h3>
"""
import pandas as pd
import numpy as np

# for visualization
import matplotlib.pyplot as plt
import seaborn as sns
from plotly.offline import iplot
import cufflinks as cf
cf.go_offline()

# for data overview
from pandas_profiling import ProfileReport
import plotly.graph_objects as go
fig = go.Figure()
import re
"""
<a id="intro"></a>
<h2>   
    <font  color='red'>
          <span>
            3. Understanding the data
            </span>   
    </font>
</h2>
"""
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            3.1 Importing the input csv
            </span>   
    </font>
</h3>
"""
movie_data = pd.read_csv("/kaggle/input/movies-on-netflix-prime-video-hulu-and-disney/MoviesOnStreamingPlatforms_updated.csv")
movie_data.head(5)
movie_data.shape
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            3.2 Overview the dataframes
            </span>   
    </font>
</h3>
"""
movie_data.info()
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            3.3 Observe Null Values
            </span>   
    </font>
</h3>
"""
movie_data.isnull().sum()
# Deal with null values

Age_Null = round(movie_data['Age'].isnull().sum()/len(movie_data['Age']) * 100 , 2)
Genres_Null = round(movie_data['Genres'].isnull().sum()/len(movie_data['Genres']) * 100 , 2)
Directors_Null = round(movie_data['Directors'].isnull().sum()/len(movie_data['Directors']) * 100 , 2)
Runtime_Null = round(movie_data['Runtime'].isnull().sum()/len(movie_data['Runtime']) * 100 , 2)
Language_Null = round(movie_data['Language'].isnull().sum()/len(movie_data['Language']) * 100 , 2)
Country_Null = round(movie_data['Country'].isnull().sum()/len(movie_data['Country']) * 100 , 2)    
Rotten_Null = round(movie_data['Rotten Tomatoes'].isnull().sum()/len(movie_data['Rotten Tomatoes']) * 100 , 2)                          
print("Age Null: {}%".format(Age_Null))
print("Genres_Null: {}%".format(Genres_Null))
print("Directors_Null: {}%".format(Directors_Null))
print("Runtime_Null : {}%".format(Runtime_Null))
print("Language_Null: {}%".format(Language_Null))
print("Country_Null: {}%".format(Country_Null))
print("Rotten_Null: {}%".format(Rotten_Null))

# Let deal with Age Column
movie_data['Age'].value_counts(), movie_data['Age'].shape
movie_data['Age'].value_counts().iplot('bar')
"""
Only less movies are targetted to the audience below age 12. and mostly OTT platforms include movie with  some age erstriction 18+
"""
movie_data[movie_data['Age'].isnull()].shape
movie_data[movie_data['Age'].isnull()]
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            3.4 Pandas Profiling
            </span>   
    </font>
</h3>
"""
!pip install pandas-profiling

profile = ProfileReport(movie_data, title="Pandas Profiling Report")

profile
"""
<a id="intro"></a>
<h2>   
    <font  color='orange'>
          <span>
            4. EDA (Exploratory Data Anslysis)
            </span>   
    </font>
</h2>
"""
# Highest Rotten tomatoes Movies and available platform
print(movie_data.columns)
movie_data.head(3)
"""
The Tomatometer score represents the percentage of professional critic reviews that are positive for a given film or television show. .
"""
# ROtten tomatoes
movie_data['Rotten Tomatoes'].value_counts()
"""
Sooo many values, Let make it general or round figure
"""
import re

def convert_str_to_int(val):
    new_val =  re.sub('%','',val)
    return(int(new_val))

def round_fix(data):
    data_str = str(data).strip()
    if data_str != 'nan':
        data = convert_str_to_int(data_str)
        if data in range(0,11):
#             print(data)
            return '10'
        if data in range(11,21):
            return '20'
        if data in range(21,31):
            return '30'
        if data in range(31,41):
            return '40'
        if data in range(41,51):
            return '50'
        if data in range(51,61):
            return '60'
        if data in range(61,71):
            return '70'
        if data in range(71,81):
            return '80'
        if data in range(81,91):
            return '90'

        if data in range(91,101):
            return '100'


movie_data['Rotten_Tomatoes_overview'] = movie_data['Rotten Tomatoes'].apply(round_fix)
movie_data['Rotten_Tomatoes_overview'].value_counts().iplot(kind='bar', bins=20, xTitle = 'Rotten Tomatoes Ratings', yTitle='Number of movies', title='OTT ROtten TOmatoes')
"""
Observations:- 

Number of approx 100 % Rotten Tomatoes movies are more in the OTT Platforms which means Movies available are reviews and liked by audiences.


COntent in OTT are better and accepted by audience.
"""
movie_data['Rotten_Tomatoes_overview'].value_counts()
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            4.1 Highest ROtten Tomatoes Movies/Shows
            </span>   
    </font>
</h3>
"""
netflix_count = movie_data[movie_data['Rotten_Tomatoes_overview'] == '100']['Netflix'].sum()
Hulu_count = movie_data[movie_data['Rotten_Tomatoes_overview'] == '100']['Hulu'].sum()
Disney_count = movie_data[movie_data['Rotten_Tomatoes_overview'] == '100']['Disney+'].sum()
prime_count = movie_data[movie_data['Rotten_Tomatoes_overview'] == '100']['Prime Video'].sum()

indexes = ['Netflix', 'Hulu', 'Disney', 'Amazon Prime']
values = [netflix_count, Hulu_count, Disney_count,prime_count]
netflix_count
from plotly.subplots import make_subplots

fig = make_subplots(
rows=1,cols=2, subplot_titles=["Highest Rottem Tomatoes movies"],
specs=[[{'type':'bar'},{'type':'pie'}]])

fig.add_trace(go.Bar(x=indexes, y=values), row=1,col=1)
fig.add_trace(go.Pie(labels=indexes, values=values), row=1,col=2)

"""
Observations:-

Amazon prime has highest rotten tomatoes movies as compared to other platform.


So, next time, Amazon Prime should be on the First prority
"""
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            4.2 Highest IMDB Rating
            </span>   
    </font>
</h3>
"""
movie_data['IMDb'].value_counts()
# convert it to round values
def round_val(data):
    if str(data) != 'nan':
        return round(data)
    
movie_data['IMDB_group'] = movie_data['IMDb'].apply(round_val)
values = movie_data['IMDB_group'].value_counts().sort_index(ascending=False).tolist()
index = movie_data['IMDB_group'].value_counts().sort_index(ascending=False).index
values,index
import seaborn as sns

movie_data['IMDB_group'].value_counts().iplot('bar', xTitle='IMDB Rating', yTitle='Num of Movies', title='IMDB RATING OVERVIEW')

"""
Observations:-

Even though there are maximum 100 % rotten tomatoes movies in the OTT Platform, Majority of the movies has only rating 6-7 out of 10.
"""
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            4.3 Top Movies and its OTT Platform
            </span>   
    </font>
</h3>
"""
netflix_count = movie_data[(movie_data['IMDB_group'] == 9) | (movie_data['IMDB_group'] == 8)]['Netflix'].sum()

netflix_count
netflix_count = movie_data[(movie_data['IMDB_group'] == 9) & (movie_data['IMDB_group'] == 8)]['Netflix'].sum()
Hulu_count = movie_data[movie_data['IMDB_group'] == 9]['Hulu'].sum()
Disney_count = movie_data[movie_data['IMDB_group'] == 9]['Disney+'].sum()
prime_count = movie_data[movie_data['IMDB_group'] == 9]['Prime Video'].sum()

indexes = ['Netflix', 'Hulu', 'Disney', 'Amazon Prime']
values = [netflix_count, Hulu_count, Disney_count,prime_count]
fig = make_subplots(
rows=1,cols=2, subplot_titles=["Top IMDB Rated Movies"],
specs=[[{'type':'bar'},{'type':'pie'}]])

fig.add_trace(go.Bar(x=indexes, y=values), row=1,col=1)
fig.add_trace(go.Pie(labels=indexes, values=values), row=1,col=2)


"""
Observations:
    
Top IMDB movies are present in the Amazon prime 
"""
# let explore Amazon Prime movies
prime_movies = movie_data[(movie_data['IMDB_group'] == 9) & (movie_data['Prime Video'] == 1)]



prime_movies.shape
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            4.4 Top Language Movies
            </span>   
    </font>
</h3>
"""
prime_movies['Language'].value_counts().iplot('bar')
"""
Observations:-


TO target larger audience, top imdb movies are dubbed in English

Best part is : it also includes Hindi movies too
"""
prime_movies[prime_movies['Language'] == 'Hindi']['Title'].value_counts()
"""
Top IMDB Rated SHows/Movies on Amazon Prime (Hindi Language)

Anand,

GOlmaal

Zakir Khan


"""
"""
#Check about my favourite director:-
(1) Nolan
(2) RUsso brothers




"""
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            4.5 Best Christopher Nolan's Movies
            </span>   
    </font>
</h3>
"""
movie_data.head(4)
nolan_movie = movie_data[movie_data['Directors'] == 'Christopher Nolan']
nolan_movie
nolan_movie[['Title', 'Netflix','Hulu','Disney+','Prime Video', 'IMDB_group']]
"""
Observations:

Nolan movies are basically have imdb rating above 7, which is very rare.

Also, this is expected because Nolan is visionary director
"""
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            4.6 Best Russo Brother's Movies
            </span>   
    </font>
</h3>
"""
russo_movie =  movie_data[movie_data['Directors'] == 'Anthony Russo,Joe Russo']
russo_movie[['Title', 'Netflix','Hulu','Disney+','Prime Video', 'IMDB_group']]
"""
Observation:

Russo Brothers are extra-ordinary directors who have movies rating above 7+.

Also, They have deal with the Disney+ as DIsney+ has more Russo movies as compared to other OTT platform.
"""
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            4.7 Highly Recommended Movies/Shows
            </span>   
    </font>
</h3>
"""
movie_data[:10]['Title']
"""
Recommended movies
"""
def ott_platform(data):
    if data == 1:
        return 'netflix'
    else:
        return data
    
movie_data['Netflix'] = movie_data['Netflix'].apply(ott_platform)
def hulu_platform(data):
    if data == 1:
        return 'hulu'
    else:
        return data
    
def disney_platform(data):
    if data == 1:
        return 'disney'
    else:
        return data
    
def prime_platform(data):
    if data == 1:
        return 'prime'
    else:
        return data

    
    
movie_data['Hulu'] = movie_data['Hulu'].apply(hulu_platform)    
movie_data['Prime Video'] = movie_data['Prime Video'].apply(prime_platform)  
movie_data['Disney+'] = movie_data['Disney+'].apply(disney_platform)  
movie_data
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            4.8 Movies/Shows on OTT Platforms
            </span>   
    </font>
</h3>
"""
"""
we will take  major category in the movie type like thriller, comedy, fantasy etc.

if movie is based on comedy, romance, we will categorize as comedy
"""
def check_thriller(data):
#     printdata)
    if str(data).strip() != 'nan':
#         print(data)
        if 'horror' in data.lower():
            return 'horror'
        elif 'thriller' in data.lower():
            return 'thriller'
        elif 'sci-fi' in data.lower():
            return 'sci-fi'
        elif 'documentary' in data.lower():
            return 'documentary'
        elif 'action' in data.lower():
            return 'action'
        elif 'animation' in data.lower():
            return 'animation'
        elif 'comedy' in data.lower():
            return 'comedy'
        elif 'western' in data.lower():
            return  'western'
        elif 'drama' in data.lower():
            return 'drama'
        elif 'fantasy' in data.lower():
            return 'fantasy'
        elif 'romance' in data.lower():
            return 'romance'
        elif 'music' in data.lower():
            return 'music'
        elif 'adventure' in data.lower():
            return 'adventure'
        elif 'sport' in data.lower():
            return 'sport'
        elif 'reality-tv' in data.lower() or 'talk-show' in data.lower() or 'game-show' in data.lower():
            return 'tv-show'
        elif 'history' in data.lower():
            return 'history'
        elif 'family' in data.lower():
            return 'family'
        elif 'biography' in data.lower():
            return 'biography'
        elif 'biography' in data.lower():
            return 'biography'
        elif 'mystery' in data.lower():
            return 'Mystery'
        elif 'war' in data.lower():
            return 'war'
        
movie_data['mov_type'] = movie_data['Genres'].apply(check_thriller)
movie_data[movie_data['mov_type'].isnull()]['Genres'].unique()
movie_data['mov_type'].value_counts().iplot('bar')
"""
Observations:


OTT Platforms mostly have movies like documentary, horror, action, and drama
"""
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            4.9 Best Thriller Movies/Shows
            </span>   
    </font>
</h3>
"""
 top_movie = movie_data[movie_data['IMDB_group'] == 9]
top_movie['mov_type'].value_counts().iplot(kind='bar')
"""
Observations:


IMDB 9+ rating shows available on OTT platforms are documentary and drama type.

let explore one by one, as per the user's choice
"""
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            4.8 Movies/Shows on OTT Platforms
            </span>   
    </font>
</h3>
"""
top_movie[top_movie['Netflix']=='netflix']['mov_type'].value_counts().values
net_index = top_movie[top_movie['Netflix']=='netflix']['mov_type'].value_counts().index.tolist()
net_val = (top_movie[top_movie['Netflix']=='netflix']['mov_type'].value_counts().values.tolist())

prime_index = top_movie[top_movie['Prime Video']=='prime']['mov_type'].value_counts().index
prime_val = (top_movie[top_movie['Prime Video']=='prime']['mov_type'].value_counts().values.tolist())

disney_index = top_movie[top_movie['Disney+']=='disney']['mov_type'].value_counts().index
disney_val = (top_movie[top_movie['Disney+']=='disney']['mov_type'].value_counts().values.tolist())

hulu_index = top_movie[top_movie['Hulu']=='hulu']['mov_type'].value_counts().index
hulu_val = (top_movie[top_movie['Hulu']=='hulu']['mov_type'].value_counts().values.tolist())
top_movie[top_movie['mov_type'] == 'animation']
print(net_index)
print(net_val)
fig = make_subplots(
rows=1,cols=2, subplot_titles=["Netflix v/s Prime"],
specs=[[{'type':'pie'},{'type':'pie'}]])

fig.add_trace(go.Pie(labels=net_index, values=net_val, title='Netflix'), row=1,col=1)
fig.add_trace(go.Pie(labels=prime_index, values=prime_val, title='Prime'), row=1,col=2)
fig.update_layout(height=800, width=1000, title_text='Top IMDB Movies/Show')

"""
Observations:


DOcumentary movies are more available in Prime as compared to Netflix where it has more animation movies/


Here, winner is Netflix, because it has focus equally on all the genre like thriller, sport, animation or documentary. Hence, Audience will binge watch Netflix more because of the varieties available
"""
print(hulu_index)
print(hulu_val)
print(disney_index)
print(disney_val)
fig = make_subplots(
rows=1,cols=2, subplot_titles=["Disney v/s Hulu"],
specs=[[{'type':'pie'},{'type':'pie'}]])

fig.add_trace(go.Pie(labels=hulu_index, values=hulu_val, title='Hulu'), row=1,col=1)
fig.add_trace(go.Pie(labels=disney_index, values=disney_val, title='DIsney'), row=1,col=2)
fig.update_layout(height=400, width=600, title_text='Top IMDB Movies/Show')
"""
Observations:


Disney only has SCI-FI movies like avengers movies and similiar. (because it is new in the market of OTT)
Hulu mainly focus on Drama and thriller equally as these two domains are most liked by audiences
"""
# Top THriller movies
top_movie.head(3)
thriller_top = top_movie[top_movie['mov_type'] =='thriller']
thriller_top[['Title','Netflix','Hulu','Prime Video','Disney+']]
"""
Observations:


Highly Recommended THriller movies to watch once in a life.

It also contains Parasite (Oscar 2019 Best movie) which is available on prime.
"""
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
           4.9 Best Animation Movies/Show
            </span>   
    </font>
</h3>
"""
animation_top = thriller_top = top_movie[top_movie['mov_type'] =='animation']
animation_top.head(12)
"""
Observations:
    
Only 9+IMDB Rating movie is : True: Happy Hearts Day - Netflix
"""
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            4.10 Top Action Movies/Shows
            </span>   
    </font>
</h3>
"""
action_top = thriller_top = top_movie[top_movie['mov_type'] =='action']
action_top.head(12)
"""
Observations:


Best Action Movie:   The Mountain 2   - Prime
"""
"""
<a id="intro"></a>
<h3>   
    <font  color='orange'>
          <span>
            4.11 Best SCI-FI Movies/Shows
            </span>   
    </font>
</h3>
"""
sci_top = thriller_top = top_movie[top_movie['mov_type'] =='sci-fi']
sci_top.head(12)[['Title','Netflix','Hulu', 'Disney+', 'Prime Video']]
movie_data[movie_data['Title'] == 'Avengers: Infinity War'][['Title', 'IMDB_group']]
"""
Avengers has 8 IMDB Rating.

Therefore, we have only considered movies which have exact 9+ IMDB Rating. 
"""
movie_data['Language'].value_counts()
"""
OTT contains almost all the languages in the database
"""
movie_data['Age'].value_counts().iplot('bar', xTitle='Age Group', yTitle='Movies',title='Age Data')
"""
As censor board 's rules are not applicable in the OTT platforms, there are certain age restriction in the movies like action, violence, graphical content and many more.

"""
"""
Conclusion
"""
# Netflix movies

movie_data.head(3)
netflix_movies = movie_data[movie_data['Netflix'] == 'netflix']
hulu_movies = movie_data[movie_data['Hulu'] == 'hulu']
disney_movies = movie_data[movie_data['Disney+'] == 'disney']
prime_movies = movie_data[movie_data['Prime Video'] == 'prime']
netflix_movies.drop(['Hulu','Disney+','Prime Video', 'Unnamed: 0'], axis=1, inplace=True)
hulu_movies.drop(['Netflix','Disney+','Prime Video', 'Unnamed: 0'], axis=1, inplace=True)
disney_movies.drop(['Hulu','Netflix','Prime Video', 'Unnamed: 0'], axis=1, inplace=True)
prime_movies.drop(['Hulu','Disney+','Netflix', 'Unnamed: 0'], axis=1, inplace=True)
print("Netflix Movies: ", netflix_movies.shape[0])
print("Hulu Movies: ", hulu_movies.shape[0])
print("Disney+ Movies: ", disney_movies.shape[0])
print("Prime Movies: ", prime_movies.shape[0])
# Netflix Movies
"""
<a id="intro"></a>
<h2>   
    <font  color='red'>
          <span>
            5. Netflix Overview
            </span>   
    </font>
</h2>
"""
netflix_movies.head(4)
netflix_movies['Language'].value_counts()[:30].iplot('bar')
"""
In Netflix, English language is common in all the movies.
"""
# Runtime
runtime_net = netflix_movies.sort_values(by='Runtime',ascending=False).head(20)
runtime_net

sns.barplot(data=runtime_net, y='Title',x='Runtime')
plt.title('Top Runtime movies on Netflix')
net_movies = netflix_movies[netflix_movies['IMDb'] > 8]
net_movies_count = net_movies.shape[0]
print("Movies with IMDB 8+ Rating in netflix: {}".format(net_movies_count))
net_movies = net_movies.sort_values(by='IMDb', ascending=False).head(10)
sns.barplot(data=net_movies, y='Title',x='IMDb')
plt.title('Top IMDB movies on Netflix')
movie_type = netflix_movies['mov_type'].value_counts().index.tolist()
print(movie_type[:9])
# thriller movies

def movie_plot(movie) : 
    print(movie)
    thriller_net = netflix_movies[netflix_movies['mov_type'] == movie]
    net_movies = thriller_net.sort_values(by='IMDb', ascending=False).head(10)
    sns.barplot(data=net_movies, y='Title',x='IMDb')
    plt.title('Top 10 {} movies on Netflix'.format(movie))

movie_plot('thriller')
movie_plot('sci-fi')
movie_plot('action')
movie_plot('horror')
movie_plot('animation')
hulu_movies.head(4)
def run_time(dataframe,ott):
    runtime_data = dataframe.sort_values(by='Runtime',ascending=False).head(10)
    sns.barplot(data=runtime_data,y='Title',x='Runtime')
    plt.title("Top Runtime movies on {}".format(ott))
def top_imdb(dataframe,ott):
    movies = dataframe[dataframe['IMDb'] > 8]
    movies = movies.sort_values(by='IMDb',ascending=False).head(10)
    sns.barplot(data=movies,y='Title',x='IMDb')
    plt.title("Top IMDB movies on {}".format(ott))
def movie_plot_plat(movie, dataframe, ott) : 
    print(movie)
    thriller_net = dataframe[dataframe['mov_type'] == movie]
    net_movies = thriller_net.sort_values(by='IMDb', ascending=False).head(10)
    sns.barplot(data=net_movies, y='Title',x='IMDb')
    plt.title('Top 10 {} movies on {}'.format(movie, ott))
# HULU

run_time(hulu_movies,'HULU')
top_imdb(hulu_movies, 'HULU')
movie_plot_plat('thriller',hulu_movies,'hulu')
movie_plot_plat('action',hulu_movies,'hulu')
movie_plot_plat('horror',hulu_movies,'hulu')
movie_plot_plat('animation',hulu_movies,'hulu')
movie_plot_plat('sci-fi',hulu_movies,'hulu')
# diSNEY+

run_time(disney_movies,'Disney')


top_imdb(disney_movies, 'Disney')

movie_plot_plat('thriller',disney_movies,'Disney')

movie_plot_plat('action',disney_movies,'Disney')

movie_plot_plat('horror',disney_movies,'Disney')

movie_plot_plat('animation',disney_movies,'Disney')

movie_plot_plat('sci-fi',disney_movies,'Disney')
# Prime

run_time(prime_movies,'Prime')
top_imdb(prime_movies, 'Prime')

movie_plot_plat('thriller',prime_movies,'Prime')
movie_plot_plat('action',prime_movies,'Prime')
movie_plot_plat('horror',prime_movies,'Prime')
movie_plot_plat('animation',prime_movies,'Prime')
movie_plot_plat('sci-fi',prime_movies,'Prime')
"""
![upvote.jpg](attachment:upvote.jpg)
"""