x=r'C:\Users\beladiy\Desktop\python\DAT210x-master\Module2\Datasets\Servo.data'
df=pd.read_csv(x,names=['motor', 'screw', 'pgain', 'vgain', 'class'],header=None)
如何从vgain
创建包含等于5
的值的切片?
答案 0 :(得分:0)
试试这个
x=r'C:\Users\beladiy\Desktop\python\DAT210x-master\Module2\Datasets\Servo.data'
df=pd.read_csv(x,names=['motor', 'screw', 'pgain', 'vgain', 'class'],header=None)
df=df[df.vgain==5]