Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  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"]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement