Loved by learners at thousands of companies
Sampling in Python is the cornerstone of inference statistics and hypothesis testing. It's a powerful skill used in survey analysis and experimental design to draw conclusions without surveying an entire population. In this Sampling in Python course, you’ll discover when to use sampling and how to perform common types of sampling—from simple random sampling to more complex methods like stratified and cluster sampling. Using real-world datasets, including coffee ratings, Spotify songs, and employee attrition, you’ll learn to estimate population statistics and quantify uncertainty in your estimates by generating sampling distributions and bootstrap distributions.
Bias Any Stretch of the ImaginationFree
Learn what sampling is and why it is so powerful. You’ll also learn about the problems caused by convenience sampling and the differences between true randomness and pseudo-randomness.Living the sample life50 xpReasons for sampling50 xpSimple sampling with pandas100 xpSimple sampling and calculating with NumPy100 xpA little too convenient50 xpAre the findings from this sample generalizable?100 xpAre these findings generalizable?100 xpHow does Sue do sampling?50 xpGenerating random numbers100 xpUnderstanding random seeds100 xp
Don't get theory eyed
It’s time to get hands-on and perform the four random sampling methods in Python: simple, systematic, stratified, and cluster.Simple is as simple does50 xpSimple random sampling100 xpSystematic sampling100 xpIs systematic sampling OK?100 xpCan't get no stratisfaction50 xpWhich sampling method?100 xpProportional stratified sampling100 xpEqual counts stratified sampling100 xpWeighted sampling100 xpWhat a cluster...50 xpBenefits of clustering50 xpCluster sampling100 xpStraight to the point (estimate)50 xp3 kinds of sampling100 xpComparing point estimates100 xp
The n's justify the means
Let’s test your sampling. In this chapter, you’ll discover how to quantify the accuracy of sample statistics using relative errors, and measure variation in your estimates by generating sampling distributions.An ample sample50 xpCalculating relative errors100 xpRelative error vs. sample size50 xpBaby back dist-rib-ution50 xpReplicating samples100 xpReplication parameters50 xpBe our guess, put our samples to the test50 xpExact sampling distribution100 xpApproximate sampling distribution100 xpExact vs. approximate50 xpErr on the side of Gaussian50 xpPopulation & sampling distribution means100 xpPopulation & sampling distribution variation100 xp
Pull Your Data Up By Its Bootstraps
You’ll get to grips with resampling to perform bootstrapping and estimate variation in an unknown population. You’ll learn the difference between sampling distributions and bootstrap distributions using resampling.This bears a striking resample-lance50 xpPrinciples of bootstrapping100 xpWith or without replacement?100 xpGenerating a bootstrap distribution100 xpA breath of fresh error50 xpBootstrap statistics and population statistics50 xpSampling distribution vs. bootstrap distribution100 xpCompare sampling and bootstrap means100 xpCompare sampling and bootstrap standard deviations100 xpVenus infers50 xpConfidence interval interpretation50 xpCalculating confidence intervals100 xpCongratulations50 xp
PrerequisitesIntroduction to Statistics in Python
Content Developer, DataCamp
James is a Content Developer at DataCamp. He has a Master's degree in Physics and Astronomy from Durham University, where he specialized in quasar detection and tutored Math and English. He joined DataCamp as a learner in 2018, and the data skills learned on DataCamp were quickly integrated into his scientific projects. In his spare time, he enjoys restoring retro toys and electronics.
Follow James on LinkedIn
Follow James on LinkedIn
What do other learners have to say?
I've used other sites—Coursera, Udacity, things like that—but DataCamp's been the one that I've stuck with.
Devon Edwards Joseph
Lloyds Banking Group
DataCamp is the top resource I recommend for learning data science.
Harvard Business School
DataCamp is by far my favorite website to learn from.
Decision Science Analytics, USAA