drop()参数解释:
text.drop([],axis= ,inplace= )
默认情况下 axis为0,删除某一行,若要删除某一列,axis=1
inplace=True时,在原来数据上改变,默认inplace为False,不改变原来数据
import pandas as pd
import numpy as np
from pandas import DataFrame
test = DataFrame(np.arange(16).reshape((4,4)),index=['0','1','2','3'],columns=['a','b','c','d'])
test1 = test.drop(['a','b','c'],axis=1)#删除a,b,c列
test2 = test.drop(['1'])#删除1那一列,axis默认为0
print(test1)
print(test2)
输出结果: