text_html_output_1.png
from plotly.subplots import make_subplots

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

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

import plotly.graph_objects as go

df = pd.read_csv('../input/netflix-shows/netflix_titles.csv')

df.shape

df.drop(columns=['show_id'], inplace=True)

df.drop(columns=['null1'], inplace=True)
df['day_added'] = df['day_added'].str.replace(',', '')

df.columns

df = df[['type', 'title', 'country', 'month_added', 'day_added', 'year_added', 'release_year', 'rating', 'duration', 'listed_in', 'description', 'director', 'cast']]

import plotly.graph_objects as go
import math
df_type = pd.DataFrame(df['type'].value_counts())
df_type
fig = go.Figure(data=go.Bar(x=df_type.index, y=df_type['type']))
'{:.2f}'.format(13.95)

df_country = pd.DataFrame(df['country'].value_counts())

# Let's examine how many countries we have
df_country.shape
# we will be only visualize for top 15 countries
df_country.sort_values(by = ["country"], ascending = False, inplace = True)
df_count15 = df_country.head(15)

from plotly.subplots import make_subplots
# Let's do ead for the df_country
fig = go.Figure(data=go.Bar(x = df_count15.index, y = df_count15["country"]))

fig = make_subplots(rows=1, cols=2, column_widths=[0.7, 0.3])

fig.add_trace(go.Bar(x=df_count15.index, y=df_count15["country"]),
              row=1, col=1)

fig.add_trace(go.Scatter(x=df_count15.index, y=df_count15["country"]),
              row=1, col=2)

fig.show()

df_rating = pd.DataFrame(df['rating'].value_counts())
df_rating.head()
fig = go.Figure(data=[go.Pie(labels=df_rating.index, values=df_rating['rating'])])
fig.show()