我认为您需要
numpy.r_并发索引:
df.iloc[:,np.r_[0,1,51:102]]
样品:
df = pd.Dataframe([[0] * 10], columns=list('abcdefghij'))print (df) a b c d e f g h i j0 0 0 0 0 0 0 0 0 0 0print (df.iloc[:,np.r_[0,1,5:8]]) a b f g h0 0 0 0 0 0
我认为您需要
numpy.r_并发索引:
df.iloc[:,np.r_[0,1,51:102]]
样品:
df = pd.Dataframe([[0] * 10], columns=list('abcdefghij'))print (df) a b c d e f g h i j0 0 0 0 0 0 0 0 0 0 0print (df.iloc[:,np.r_[0,1,5:8]]) a b f g h0 0 0 0 0 0