 the 21st, 2013. Local organiser ReedPOP given the duty for piecing together the inaugural PAX event.
As a local Melbourne resident, the news is fantastic for me to hear since I won’t have to travel so far next year, at least for one event. What are your feelings on it?
[SOURCE]: PAX Australia Is Heading To Melbourne<jupyter_start><jupyter_text>Project 2: Analyzing IMDb Data_Author: <NAME> (DC)_--- For project two, you will complete a series of exercises exploring movie rating data from IMDb.For these exercises, you will be conducting basic exploratory data analysis on IMDB's movie data, looking to answer such questions as:What is the average rating per genre?How many different actors are in a movie?This process will help you practice your data analysis skills while becoming comfortable with Pandas.  Basic level<jupyter_code>import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline<jupyter_output><empty_output><jupyter_text>Read in 'imdb_1000.csv' and store it in a DataFrame named movies.<jupyter_code>movies = pd.read_csv('./data/imdb_1000.csv')
movies.head()<jupyter_output><empty_output><jupyter_text>Check the number of rows and columns.<jupyter_code># Answer:

#create data frame:
df = pd.DataFrame(movies, index = None)

#check rows:
rows = len(df.axes[0])

#print rows:
print(rows)<jupyter_output><empty_output><jupyter_text>Check the data type of each column.<jupyter_code># Answer:

dataTypeSeries = movies.dtypes

#print data type:
print(dataTypeSeries)<jupyter_output><empty_output><jupyter_text>Calculate the average movie duration.<jupyter_code># Answer:

movies.duration.mean()

#answer:
= 120.97957099080695<jupyter_output><empty_output><jupyter_text>Sort the DataFrame by duration to find the shortest and longest movies.<jupyter_code># Answer:
movies.sort('duration').head(1)
#
movies.sort('duration').tail(1)<jupyter_output><empty_output><jupyter_text>Create a histogram of duration, choosing an "appropriate" number of bins.<jupyter_code># Answer:

movies.duration.plot(kind='hist', bins=20)<jupyter_output><empty_output><jupyter_text>Use a box plot to display that same data.<jupyter_code># Answer:

movies.duration.plot(kind='box')<jupyter_output><empty_output><jupyter_text>Intermediate level  Count how many movies have each of the content ratings.<jupyter_code># Answer:

movies.content_rating.value_counts()<jupyter_output><empty_output><jupyter_text>Use a visualization to display that same data, including a title and x and y labels.<jupyter_code># Answer:

movies.content_rating.value_counts().plot(kind='bar', title='Top 1000 Movies by Content Rating')
plt.xlabel('Content Rating')
plt.ylabel('Number of Movies')<jupyter_output><empty_output><jupyter_text>Convert the following content ratings to "UNRATED": NOT RATED, APPROVED, PASSED, GP.<jupyter_code># Answer:

movies.content_rating.replace(['NOT RATED', 'APPROVED', 'PASSED', 'GP'], 'UNRATED', inplace=True)<jupyter_output><empty_output><jupyter_text>Convert the following content ratings to "NC-17": X, TV-MA.<jupyter_code># Answer:

movies.content_rating.replace(['X', 'TV-MA'], 'NC-17', inplace=True)<jupyter_output><empty_output><jupyter_text>Count the number of missing values in each column.<jupyter_code># Answer:

movies.isnull().sum()<jupyter_output><empty_output><jupyter_text>If there are missing values: examine them, then fill them in with "reasonable" values.<jupyter_code># Answer:

#identifying misisng values
movies[movies.content_rating.isnull()]
#adding fill
movies.content_rating.fillna('UNRATED', inplace=True)<jupyter_output><empty_output><jupyter_text>Calculate the average star rating for movies 2 hours or longer, and compare that with the average star rating for movies shorter than 2 hours.<jupyter_code># Answer:

#average star rating
movies[movies.duration >= 120].star_rating.mean()

#comparison

movies[movies.duration < 120].star_rating.mean()<jupyter_output><empty_output><jupyter_text>Use a visualization to detect whether there is a relationship between duration and star rating.<jupyter_code># Answer:

movies.plot(kind='scatter', x='star_rating', y='duration', alpha=0.2)<jupyter_output><empty_output><jupyter_text>Calculate the average duration for each genre.<jupyter_code># Answer:
movies = pd.read_csv('./data/imdb_1000.csv')
movies.groupby('genre').duration.mean()

#results:
genre
Action       126.485294
Adventure    134.840000
Animation     96.596774
Biography    131.844156
Comedy       107.602564
Crime        122.298387
Drama        126.539568
Family       107.500000
Fantasy      112.000000
Film-Noir     97.333333
History       66.000000
Horror       102.517241
Mystery      115.625000
Sci-Fi       109.000000
Thriller     114.200000
Western      136.666667
Name: duration, dtype: float64<jupyter_output><empty_output><jupyter_text>Advanced level  Visualize the relationship between content rating and duration.<jupyter_code># Answer:

#content rating:
movies.boxplot(column='duration', by='content_rating')

#duration:
movies.duration.hist(by=movies.content_rating, sharex=True)<jupyter_output><empty_output><jupyter_text>Determine the top rated movie (by star rating) for each genre.<jupyter_code># Answer:
movies.sort('star_rating', ascending=False).groupby('genre').title.first()
movies.groupby('genre').title.first()<jupyter_output><empty_output><jupyter_text>Check if there are multiple movies with the same title, and if so, determine if they are actually duplicates.<jupyter_code># Answer:

dupe_titles = movies[movies.title.duplicated()].title
movies[movies.title.isin(dupe_titles)]<jupyter_output><empty_output><jupyter_text>Calculate the average star rating for each genre, but only include genres with at least 10 movies  Option 1: manually create a list of relevant genres, then filter using that list<jupyter_code># Answer:

movies.genre.value_counts()
top_genres = ['Drama', 'Comedy', 'Action', 'Crime', 'Biography', 'Adventure', 'Animation', 'Horror', 'Mystery']
movies[movies.genre.isin(top_genres)].groupby('genre').star_rating.mean()<jupyter_output><empty_output><jupyter_text>Option 2: automatically create a list of relevant genres by saving the value_counts and then filtering<jupyter_code># Answer:

genre_counts = movies.genre.value_counts()
top_genres = genre_counts[genre_counts >= 10].index
movies[movies.genre.isin(top_genres)].groupby