Statistics, data mining, and machine learning in astronomy : a practical Python guide for the analysis of survey data