<jupyter_start><jupyter_text>Top Directors<jupyter_code># Import requirements
import warnings

import matplotlib.pyplot as plt
import pandas as pd
# Set defaults
%matplotlib inline
warnings.filterwarnings('ignore')
plt.style.use('fivethirtyeight')
pd.set_option('display.max_rows', 50)
pd.set_option('display.max_columns', 50)
movies = pd.read_csv("archive/Movie_Movies.csv", low_memory=False)
# Overview
movies.head()
# General info
movies.info()
# Description on some columns
movies.describe()
# Sort by rating
movies.filter('imdbVotes'>1000).sort_values("imdbRating", ascending=False).head(10)
movies.isnull().sum()
movies.Director.value_counts().head(10)
director_counts = movies['Director'].value_counts().head(10).to_frame().reset_index()
director_counts.columns = ['Director','NumberOfMoviesProduced']
director_counts.style.hide_index()
ratings.info()
ratings.drop('Unnamed: 0', axis=1, inplace=True)

movies_rating = (ratings
                  .set_index("imdbID")
                  .join(movies.set_index("imdbID"),
                        how="left")
                 )
movies_rating.head()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13893805309734514, 'fraction_numerical': 0.01415929203539823, 'mean_word_length': 5.146739130434782, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '450420', 'license': 'MIT', 'n_tokens_mistral': 404, 'n_tokens_neox': 374, 'n_words': 60, 'path': 'data_movies/.ipynb_checkpoints/top-directors-checkpoint.ipynb', 'repo_name': 'ekpyrosis/data_movies', 'size': '1130'}