add sample_discrete to cstats.pyx, lightly tested