Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

drop every other column pandas

#We would like to drop every other column
data = data.loc[:, np.arange(len(data.columns)) %2 == 0]
 
PREVIOUS NEXT
Tagged: #drop #column #pandas
ADD COMMENT
Topic
Name
3+9 =