https://stacks.pythonprogramminghelp.com/how-to-pps-sampling-in-3-easy-steps/