Nabih Bawazir :
Here's my data
Id Column1 Column2 Column3 Column4 .... Column112 Column113 ... Column143
1 67 89 86 43 56 72 67
The Output I expected,
Id Column1 Column113 ... Column143
1 67 72 67
What I did
df.drop(['Column2', 'Column3', ... ,'Column112'], axis = 1)
But this is not efficient, how to do this effectively?
jezrael :
Use:
df1 = df.drop(df.loc[:, 'Column2':'Column112'].columns, axis=1)