This video shows how to delete rows Data Frames in the Pandas library for Python.
Code used in this Python Code Clip:
import pandas as pd
import statsmodels.api as sm #(To access mtcars dataset)
mtcars = sm.datasets.get_rdataset(“mtcars”, “datasets”, cache=True).data
mtcars.head()
mtcars = mtcars.drop([“Mazda RX4 Wag”], # Rows to drop
axis = 0) # 0 for rows
mtcars.head()
mtcars = mtcars.drop(mtcars.index[[0,2]], # Rows indicies to drop
axis = 0) # 0 for rows
mtcars.head()
Subscribe : https://www.youtube.com/channel/UCwuvoN0QKjrXUi48G_Hv7kQ
#python