How to generate normally distributed data in Python
Land Your First Data Science Job
A proven roadmap to prepare for $75K+ entry-level data roles. Perfect for Data Scientist ready to level up their career.
Python comes in handy when you want to generate data.
Using the NumPy library you will be able to generate data based on various distributions.
Here is an example of data generated using a normal distribution using the numpy.random.normal():
# We import numpy
import numpy as np
# We define our variables in order to generate data
mu = 0
std = 1
n = 10
# Normally distributed list
list_of_normally_distributed_obs = np.random.normal(mu, std, n)
Here you are! You now know how to generate normally distributed data in Python!
More on fundamentals
If you want to know more about Python fundamentals without headaches... check out the other articles I wrote by clicking just here:
Land Your First Data Science Job
A proven roadmap to prepare for $75K+ entry-level data roles. Perfect for Data Scientist ready to level up their career.
Related Articles
Continue your learning journey with these related topics
Master Data Science in Days, Not Months 🚀
Skip the theoretical rabbit holes. Get practical data science skills delivered in bite-sized lessons – Approach used by real data scientist. Not bookworms. 📚