Baisc python implementation of stratified sampling using numpy arrays