Python pandas drop columns rows
import pandas as pd
from sklearn.datasets import load_iris
# load dataset
iris = load_iris()
df = pd.DataFrame(iris.data, columns= iris.feature_names)
df.head()
Drop row(s): axis = 0, by default
df.drop(0).head()
df.drop([0,2,4]).head()
Drop column(s): axis = 1
df.drop(['sepal length (cm)'], axis = 1).head()
df.drop(['sepal length (cm)', 'sepal width (cm)'], axis = 1).head()