I am having a csv file with columns sentence, length, category and 18 more columns. I am trying to filter out specific columns.
Assume I have x,y,a,b,c,d,e,f,g,h as last 10 columns. I am trying to filter out length, category and the last eight columns.
when I do it for the last 8 columns alone as,
col_req = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
data = pd.read_csv('data.csv', names=col_req)
it is working perfectly. but when I try,
col_req = ['length','category','a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
data = pd.read_csv('data.csv', names=col_req)
the output is,
('g', 'h', 'x', 'y', 'a', 'b', 'c', 'd', 'e', 'f')
I don't know where I am I going wrong.