Articles → Pandas → Delete rows from DataFrame in pandas

Delete rows from DataFrame in pandas






Deleting row




import numpy as np
import pandas as pd


df = pd.DataFrame(np.random.randn(5,4),['A', 'B', 'C', 'D', 'E'],['W', 'X', 'Y', 'Z'])



print("DataFrame before deleting new row")
print(df)

df.drop('E', inplace=True)

print("DataFrame after deleting new row")
print(df)





Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Monday, April 15, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250