Advertisement
elena1234

indexing and slicing in Python

Jan 4th, 2023
1,177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | Source Code | 0 0
  1. rows = list(range(5)) + [354, 765]
  2. rows
  3. summer.iloc[rows]
  4.  
  5. #################################
  6. col = summer.columns[:3].to_list() + ["Gender", "Event"]
  7. col
  8. summer.loc[:, col]
  9.  
  10. #################################
  11. summer.loc[[200, 300], ["Athlete", "Medal"]]
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement