df_train = pd.read_csv(TRAIN_CSV)
df_valid = pd.read_csv(VALID_CSV)
df_test0 = df_valid.iloc[ 0:NB_CLASSES*1,:]
df_test1 = df_valid.iloc[NB_CLASSES*1:NB_CLASSES*2,:]
df_test2 = df_valid.iloc[NB_CLASSES*2:NB_CLASSES*3,:]
df_test3 = df_valid.iloc[NB_CLASSES*3:NB_CLASSES*4,:]
df_test4 = df_valid.iloc[NB_CLASSES*4:NB_CLASSES*5,:]
df_test5 = df_valid.iloc[NB_CLASSES*5:NB_CLASSES*6,:]
df_test6 = df_valid.iloc[NB_CLASSES*6:NB_CLASSES*7,:]
df_test7 = df_valid.iloc[NB_CLASSES*7:NB_CLASSES*8,:]
df_test8 = df_valid.iloc[NB_CLASSES*8:NB_CLASSES*9,:]
df_test9 = df_valid.iloc[NB_CLASSES*9:NB_CLASSES*10,:]
df_valid2 = df_valid.iloc[<b>pd.np.r_</b>[
NB_CLASSES*4:NB_CLASSES*5,
NB_CLASSES*9:NB_CLASSES*10]]
df_test2 = df_valid.iloc[<b>pd.np.r_</b>[
NB_CLASSES*3:NB_CLASSES*5,
NB_CLASSES*8:NB_CLASSES*10]]
stackoverflow.com