Q5: Save all of this director's movies and their ratings in a variable called all_movies_ratings, then print this variable. (The director with the most movies you got from the last question.) # your code here all_movies_ratings = all_movies_ratings[['movie_title', 'imdb_score']] #this will select this columns only df['movie_title'] = df['movie_title'].str.replace('Ê','') print("\nQUESTION 5:") print(all_movies_ratings)   Q6: Recommend a **random** movie that has a rating of over 8.3.  Store the random recommendation in a variable called "rand_goodmovie". What is the title and imdb_score of your recommendation?   Here are the steps: 1. Query the data ('df' DataFrame) for movies with a rating over 8.3 (imdb_score > 8.3) 2. Create a random integer index location to get a single movie recommendation 3. Save the random movie recommendation in a DataFrame called 'rand_goodmovie' 4. Save the title of the random movie recommendation in a variable "random_title" and print it 5. Save the imdb_score of the random movie recommendation in a variable "random_imdb_score" and print it # Do not modify this part, it's needed for grading import random random.seed(0) # your code here all_good_movies = df[df.imdb_score > 8.3] # Query the data ('df' DataFrame) for movies with a rating over 8.3 (imdb_score > 8.3) rand_int = random.randint(0,len(all_good_movies)) #Create a random integer index location to get a single movie recommendation rand_goodmovie = all_good_movies.loc[rand_int] #Save the random movie recommendation in a DataFrame called 'rand_goodmovie' random_title = rand_goodmovie['movie_title'] #Save the title of the random movie recommendation in a variable "random_title" and print it print("\nQUESTION 6:") print("Recommended random movie:\n"+random_title) random_imdb_score = rand_goodmovie['imdb_score'] #Save the imdb_score of the random movie recommendation in a variable "random_imdb_score" and print it print("\nIMDB score: "+str(random_imdb_score))

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

Q5:
Save all of this director's movies and their ratings in a variable called all_movies_ratings, then print this variable.
(The director with the most movies you got from the last question.)


# your code here
all_movies_ratings = all_movies_ratings[['movie_title', 'imdb_score']] #this will select this columns only
df['movie_title'] = df['movie_title'].str.replace('Ê','')
print("\nQUESTION 5:")
print(all_movies_ratings)

 

Q6:
Recommend a **random** movie that has a rating of over 8.3. 
Store the random recommendation in a variable called "rand_goodmovie".
What is the title and imdb_score of your recommendation?
 
Here are the steps:
1. Query the data ('df' DataFrame) for movies with a rating over 8.3 (imdb_score > 8.3)
2. Create a random integer index location to get a single movie recommendation
3. Save the random movie recommendation in a DataFrame called 'rand_goodmovie'
4. Save the title of the random movie recommendation in a variable "random_title" and print it
5. Save the imdb_score of the random movie recommendation in a variable "random_imdb_score" and print it

# Do not modify this part, it's needed for grading
import random
random.seed(0)


# your code here
all_good_movies = df[df.imdb_score > 8.3] # Query the data ('df' DataFrame) for movies with a rating over 8.3 (imdb_score > 8.3)
rand_int = random.randint(0,len(all_good_movies)) #Create a random integer index location to get a single movie recommendation
rand_goodmovie = all_good_movies.loc[rand_int] #Save the random movie recommendation in a DataFrame called 'rand_goodmovie'
random_title = rand_goodmovie['movie_title'] #Save the title of the random movie recommendation in a variable "random_title" and print it
print("\nQUESTION 6:")
print("Recommended random movie:\n"+random_title)

random_imdb_score = rand_goodmovie['imdb_score'] #Save the imdb_score of the random movie recommendation in a variable "random_imdb_score" and print it
print("\nIMDB score: "+str(random_imdb_score))

 

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY