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)




Picture showing the output of how to delete rows from DataFrame in pandas
Click to Enlarge


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

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250