<jupyter_start><jupyter_text>Table of Contents<jupyter_code>Version 2
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.preprocessing import LabelEncoder
data = pd.read_csv('data/5000_movies_bis.csv')
data.shape
data.drop_duplicates(inplace = True)
data.shape
numerical_cols = [col for col in data.columns if data[col].dtype != 'object']
categorical_cols = [col for col in data.columns if data[col].dtype == 'object']
categorical_cols, numerical_cols
data[numerical_cols].describe()
data.isnull().sum()
data.color.unique()
drop color
data.director_name.nunique(), data.director_name.isnull().sum()
data = data.dropna(axis = 0, subset = ['director_name'] )
data.num_critic_for_reviews.min(), data.num_critic_for_reviews.max(), data.num_critic_for_reviews.median()
data.duration.min(), data.duration.max(), data.duration.median()
data.gross.isnull().sum()
data.language.value_counts()
# count data.language.unique()
data.director_name.value_counts()
data['main_genre'] = data.genres.str.split('|').str[0]
le = LabelEncoder()
data['main_genre'] = le.fit_transform(data.main_genre)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14323607427055704, 'fraction_numerical': 0.00618921308576481, 'mean_word_length': 7.202898550724638, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '153168', 'license': 'MIT', 'n_tokens_mistral': 409, 'n_tokens_neox': 395, 'n_words': 75, 'path': 'v2.ipynb', 'repo_name': 'DROMZEE/imdb_5000_Movie_Dataset', 'size': '1131'}