text_html_output_2.png text_plain_output_1.png
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 re

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 re
merged_cat = ''
for i in df['listed_in']:
    merged_cat += i
    merged_cat += '@'
merged = re.split(', |&|@', merged_cat)
merged = [i.strip() for i in merged]
print(f'in total we have {df.shape[0]} tv series and movies and overall it is defined by {len(merged)} which accounts for {len(merged) / df.shape[0]} per show')