drop columns pandas
df.drop(columns=['B', 'C'])
df drop column
df = df.drop(['B', 'C'], axis=1)
delete rows in pandas
# importing pandas module
import pandas as pd
# making data frame from csv file
data = pd.read_csv("nba.csv", index_col ="Name" )
# dropping passed values
data.drop(["Avery Bradley", "John Holland", "R.J. Hunter",
"R.J. Hunter"], inplace = True)
# display
data
remove rows from dataframe
df.drop(['Cochice', 'Pima'])
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us