How to do it...

  1. Let's recreate the result from the final step of the Selecting the smallest from the largest recipe:
>>> movie = pd.read_csv('data/movie.csv')
>>> movie2 = movie[['movie_title', 'imdb_score', 'budget']]
>>> movie_smallest_largest = movie2.nlargest(100, 'imdb_score')
.nsmallest(5, 'budget')
>>> movie_smallest_largest
  1. Use sort_values to replicate the first part of the expression and grab the first 100 rows with the head method:
>>> movie2.sort_values('imdb_score', ascending=False).head(100)
  1. Now that we have the top 100 scoring movies, we can use sort_values with head again to grab the lowest five by budget:
>>> movie2.sort_values('imdb_score', ascending=False).head(100) 
.sort_values('budget').head()
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.35.72