<jupyter_start><jupyter_text>Project: Movie Data Analysis Table of ContentsIntroductionData WranglingExploratory Data AnalysisConclusions  IntroductionThis data set contains information about 10,000 movies collected from The Movie Database (TMDb), including user ratings and revenue. Certain columns, like ‘cast’ and ‘genres’ . Qustion 1:      How many number of movies from 1960 until 2015?    Qustion 2:    What is the top 5 Genres of Movies Taking a Long Runtime From 2000 To 2015?  Qustion 3:    is the runtime of movies really affect in a popularity?<jupyter_code># import the packages

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns<jupyter_output><empty_output><jupyter_text>Data Wrangling General Properties<jupyter_code># load dataset

df= pd.read_csv('tmdb-movies.csv')
df.head(3)
# To view number of rows and column

df.shape
# To view number of duplicated rows

sum(df.duplicated())
# To view the total of missing value in each column

df.isnull().sum()
# To view the format of the data and general information

df.info()
# Also to view format of the data only

df.dtypes<jupyter_output><empty_output><jupyter_text>Data Cleaning<jupyter_code># remove the duplicated rows

df.drop_duplicates(inplace=True)
# Check the duplicates 

sum(df.duplicated())
# to view the column

df.columns
# remove uneccary column

df.drop(['imdb_id', 'budget', 'original_title',
       'cast', 'homepage', 'director', 'tagline', 'keywords', 'overview',
        'vote_count','vote_average','revenue','id' ,'production_companies','vote_average', 'release_date', 'budget_adj',
       'revenue_adj'], axis=1, inplace=True)

# check after drop the column
df.columns
# check if there any null value
df.isnull().sum()
# convert zero value to null value
df['genres'] = df['genres'].replace(0, np.NaN)
df['release_year'] = df['release_year'].replace(0, np.NaN)
df.isnull().sum()
# drop null value
df.dropna(inplace=True)
# check for any null value - should be false 
df.isnull().sum().any()
# view dataframe after cleaning
df.head(10)<jupyter_output><empty_output><jupyter_text>Exploratory Data Analysis Q1: Number Of Movies From 1960 Until 2015<jupyter_code># here the number of movies from year 1960 to 2015
df.shape[0]
# make histogram to see the number of movies from 1960 until 2015
df.hist('release_year');
plt.title('Number of movies by year')
plt.ylabel('Number of movies')
plt.xlabel('Release year');<jupyter_output><empty_output><jupyter_text>Q2: Top 5 Genres of Movies Taking a Long Runtime From 2000 To 2015<jupyter_code>#here take the data years from 2000 until 2015, sort the data by longest runtime and print the top 5 longest runtime by genres
Years= df[df.release_year >= 2000]
RunTime_Sort = Years.sort_values('runtime', axis=0, ascending=False)
RunTime_Sort = RunTime_Sort[['genres','runtime']]
TopFive = RunTime_Sort.head(5)
TopFive
#make bar plot to see the most genres take longest runtime
TopFive.plot(kind='bar', x='genres', y='runtime', color='#e4b300')
plt.title('Top 5 Genres of movies taking a long Runtime From 2000 To 2015')
plt.ylabel('Run Time');<jupyter_output><empty_output><jupyter_text>Q3: is the runtime of movies really affect in a popularity?<jupyter_code># Scatter plot to see the if runtime affect in popularity
df.plot(kind='scatter',x='runtime',y='popularity');
plt.title('The effect of runtime in popularity of movies');<jupyter_output><empty_output><jupyter_text>ConclusionsFinaly we finesh project, in this project i faced many problems such as how to convert zeros to null values but i solve it and i invstgate the dataset by Three qustion:Question 1 | we have the number of movies from 1960 until 2015, the number is growing up from year to year that refers to the new technology makes production easy.Question 2 | we have the top 5 genres of movies by longest runtime from 2000 until 2015 and we can see the Documentary has longest runtime.Question 3 | we can see the effect of runtime in popularity of movies, so the movies less than 200 minutes has more popularity than others.<jupyter_code>from subprocess import call
call(['python', '-m', 'nbconvert', 'Investigate_a_Dataset.ipynb'])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09375741751720865, 'fraction_numerical': 0.028245905530500832, 'mean_word_length': 5.753205128205129, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 30, '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': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '224554', 'license': 'MIT', 'n_tokens_mistral': 1397, 'n_tokens_neox': 1254, 'n_words': 496, 'path': 'Movies.ipynb', 'repo_name': 'iNaif/MoviesData-Analysis', 'size': '4213'}