Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas drop column by index range

# drop columns 0 to 3
droprange = list(range(0, 4))
df.drop(df.columns[droprange], axis=1, inplace=True)
 
PREVIOUS NEXT
Tagged: #pandas #drop #column #index #range
ADD COMMENT
Topic
Name
5+6 =