Advertisement
elena1234

how to delete columns and rows in Python

May 21st, 2022 (edited)
955
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.15 KB | None | 0 0
  1. del df['id_x']
  2. del df['id_y']
  3.  
  4. #######################
  5. i = cars.loc[cars.origin == 'usa'].index
  6. cars.drop(index = i, inplace = True) # delete rows
  7.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement