select costume column by position pandas
Use this syntax: data.iloc[:, [0,1,20,22]]
Where 0,1,20 and 22 is the column index.
I have a dataset with number of columns. I need to select some columns by their position. for example, I want to select columns 0,3,6,7,15 (by position) from the dataset. I tried using iloc but it seems it is applicable in the range of position, ( I may be wrong?) If there are any better ideas?