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