Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

plot normal distribution python

import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
import math

mu = 0
variance = 1
sigma = math.sqrt(variance)
x = np.linspace(mu - 3 * sigma, mu + 3 * sigma, 100)
plt.plot(x, stats.norm.pdf(x, mu, sigma))
plt.show()
Comment

normal distribution in python

from scipy.stats import norm

# What percentage of man are shorter than 154
mean = 161
standard_deviation = 7

from scipy.stats import norm
norm.cdf(154, mean, standard_deviation)
Comment

normal distribution in python

# Generate 10 random heights
mean = 161
standard_deviation = 7

from scipy.stats import norm
norm.rvs(mean, standard_deviation, size = 10)
Comment

python plot normal distribution

import numpy as np
import matplotlib.pyplot as plt

def get_normal(n):
  mu,sigma = 10,1
  s = np.random.normal(mu, sigma, n)
  plt.hist(s, density=True)
  plt.show()

get_normal(100)
Comment

normal distribution in python

# What height are 90% of men are shorter than?
mean = 161
standard_deviation = 7

from scipy.stats import norm
norm.ppf(0.90, mean, standard_deviation)
Comment

normalize a distribution plot

sns.histplot(x, stat='density')
Comment

PREVIOUS NEXT
Code Example
Python :: how to encode a string in python 
Python :: create smtp server python 
Python :: python odd or even 
Python :: gui def python 
Python :: django-storages delete folder 
Python :: python grab results from cursor.execute 
Python :: tkinter window minsize 
Python :: embeds discord.py 
Python :: python mongodb docker 
Python :: convert pdf to word doc in python 
Python :: fastest way to compute pair wise distances python 
Python :: how to extract keys from dictreader python 
Python :: python for loop float increment 
Python :: python switch item 
Python :: pure imagination 
Python :: stackoverflow python 
Python :: python print ling line in print 
Python :: python linear search 
Python :: binary search tree python 
Python :: python sys environment 
Python :: repeat a condition n times one by one python 
Python :: how to check if element is in list python 
Python :: mean bias error 
Python :: getting python class from string 
Python :: python collection 
Python :: video timestamp opencv python 
Python :: first step creating python project 
Python :: open csv in coalb 
Python :: sqlite database python 
Python :: how to change series datatype from object to float 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =