<jupyter_start><jupyter_text>Download packages seaborn and wordcloud ( pip install "package-name")<jupyter_code>df_credits = pd.read_csv("tmdb-5000-movie-dataset\\tmdb_5000_credits.csv")
df_credits.head(2)
df_credits.info()
df_movies = pd.read_csv("tmdb-5000-movie-dataset\\tmdb_5000_movies.csv")
df_movies.head(2)
df_movies.info()<jupyter_output><class 'pandas.core.frame.DataFrame'>
RangeIndex: 4803 entries, 0 to 4802
Data columns (total 20 columns):
budget                  4803 non-null int64
genres                  4803 non-null object
homepage                1712 non-null object
id                      4803 non-null int64
keywords                4803 non-null object
original_language       4803 non-null object
original_title          4803 non-null object
overview                4800 non-null object
popularity              4803 non-null float64
production_companies    4803 non-null object
production_countries    4803 non-null object
release_date            4802 non-null object
revenue                 4803 non-null int64
runtime                 4801 non-null float64
spoken_languages        4803 non-null object
status                  4803 non-null object
tagline                 3959 non-null object
title                   4803 non-null object
vote_average            4803 non-null float64
vote_count              4803 non-null [...]<jupyter_text>Lets sort the movies by revenue and list 100 hundred movies<jupyter_code>new_indx = df_movies['revenue'].sort_values(ascending=False).index.values
sorted_movies = df_movies.reindex(new_indx)
sorted_movies =  sorted_movies[:10]<jupyter_output><empty_output><jupyter_text>Now, lets draw a bar plot (title of movie vs revenue)<jupyter_code>plt.figure(figsize= (10,10))
sns.barplot(x= sorted_movies['original_title'], y = sorted_movies['revenue'])
plt.title('Top 10 movies by revenue')
plt.xticks(rotation = 90)
plt.xlabel('Movie Titles')
plt.ylabel('Gross Revenue')
plt.show()<jupyter_output><empty_output><jupyter_text>Now, lets see if there are any correlations bet<jupyter_code>f,ax = plt.subplots( figsize = (5,5))
sns.heatmap(df_movies.corr() , annot = True , linewidths = 2 ,linecolor = 'blue', fmt = '.1f' , ax = ax )
plt.title("Correlation Matrix")
plt.show()<jupyter_output><empty_output><jupyter_text>From this correlation matrix we can see:- popularity correlates with revenue, vote_count- Revenue correlates with budget, popularity and vote_countThese correlations seem self-explanatory.Further we can see that the runtime seems to not have strong correlation with any others variables. So we can infer that the runtime of a movie doesnt seem to have much effect.Also, the vote_average seems to not have a strong correlation with any other variables.<jupyter_code>sns.jointplot(x = df_movies['vote_count'], y = df_movies['revenue'], kind = 'scatter', size=7)
plt.show()
sns.jointplot(x = df_movies['vote_count'], y = df_movies['revenue'], kind = 'reg', size=7)
plt.show()
sns.jointplot(x = df_movies['popularity'], y = df_movies['revenue'], kind = 'scatter',color='r', height=5)
plt.show()
sns.jointplot(x = df_movies['budget'], y = df_movies['revenue'], kind = 'reg',color='g', height=5)
plt.show()
sorted_movies = df_movies.reindex(new_indx)
sorted_movies =  sorted_movies[:100]
plt.subplots(figsize = (9,9))
wordcloud = WordCloud(
        background_color = "white",
        width = 512 ,
        height = 384).generate(" ".join(sorted_movies['original_title']))
plt.imshow(wordcloud)
plt.title("Word-Cloud")
plt.axis('off')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10922946655376799, 'fraction_numerical': 0.04318374259102455, 'mean_word_length': 4.062857142857143, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '291013', 'license': 'MIT', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1138, 'n_words': 290, 'path': 'Data-visualization/Data  Analysis and Visualizations.ipynb', 'repo_name': 'sagark1911/Movie-Recommendation-System', 'size': '3543'}