2017-07-29 17 views
0

當我嘗試從數據框中刪除幾列時,出現錯誤值。值錯誤:[ValueError:標籤['Link']不包含在軸中]

--> df.columns -- 
Index(['Name of School', 'Elementary, Middle, or High School', 
     'Street Address', 'ZIP Code', 'Link ', 'Healthy Schools Certified?'] 

--> df.drop('Link', axis=1) 

錯誤:

ValueError: labels ['Link'] not contained in axis 

回答

1

這樣做:

df.drop('Link ', axis=1) 

列名是'link '。它有一個空間到底

+1

它的工作....謝謝你的幫助anon –

+0

確定點擊刻度:)再次thnks! –