python中用drop函数删除某列或者某行的操作教程
import pandas as pd
import numpy as np
from pandas import dataframe
from pandas import series
df1= dataframe(
{"handsome":["timo","anni","timo"],
"smart":["mike","anni","mike"],
"beautiful":["lisa","tom","nike"]})
print(df1)
handsome smart beautiful
0 timo mike lisa
1 anni anni tom
2 timo mike nike
1、df.drop(["列名"],axis=1)
df1.drop(["handsome","smart"],axis=1)#删除列名为handsome和smart的整列
2、df.drop(columns=["列名"])
df1.drop(columns=["handsome","smart"])#删除列名为handsome和smart的整列
3、df.drop([0,1])
df1.drop([0,