Thanks for your reply!
but notice, in your code you are using the mask for getting features entries, my goal is different
for instance if the first row of the mask contains : [0 , 10 , 13 , 200] I would like to mean X[0 , :] , X[10 , :]  , X[13 , : ] , X[200 , : ] and not X[0 , 0] , X[0 , 10] , X[0 , 13] , X[0 , 200]
Thanks!