SHARE
TWEET

Untitled

a guest Sep 17th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pandas as pd
  2.  
  3. movie_ratings = [9.0, 8.9, 8.8, 8.7]
  4. movie_titles = ["The Dark Knight", "Schindler's List", "Forrest Gump", "Inception"]
  5. release_years = [2008, 1993, 1994, 2010]
  6. df = pd.DataFrame()
  7. df["rating"] = movie_ratings
  8. df["release_year"] = release_years
  9. df.index = movie_titles
  10. df.loc[["The Dark Knight", "Inception"], ["rating", "release_year"]]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top