Advertisement
Guest User

Untitled

a guest
May 20th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. import pandas as pd
  2. df = pd.read_csv('./Sample.csv')
  3. df.drop('col3', axis = 1, inplace = True) # Delete columns
  4. df.drop(df.index[[1,4]], inplace = True) # Delete rows
  5. df.to_csv('new_sample.csv', index = False) # Write to file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement