Pandas - Delete multiple columns based on column position
In your case doing numpy.r_
with iloc
(Adding copy
for prevent the future copy warning)
#import numpy as np
out = df.iloc[:,np.r_[3:6,7]].copy()
In your case doing numpy.r_
with iloc
(Adding copy
for prevent the future copy warning)
#import numpy as np
out = df.iloc[:,np.r_[3:6,7]].copy()