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

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

normalize a distribution plot

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

PREVIOUS NEXT
Code Example
Python :: pip install ffmpeg 
Python :: tkinter execute function on enter 
Python :: display text in pygame 
Python :: python nCr n choose r function 
Python :: date format django template filter 
Python :: print whole dataframe python 
Python :: open a web page using selenium python 
Python :: split list into list of lists python on every n element 
Python :: python paramiko check ssh connection 
Python :: square (n) sum 
Python :: python datetime minus 1 day 
Python :: check iterable python 
Python :: python sorted descending 
Python :: python tkinter close gui window 
Python :: calculate highest frequency or mode in pandas dataframe 
Python :: wait for input python 
Python :: meme command discord.py 
Python :: matplotlib plot dpi 
Python :: python get domain from url 
Python :: rvec tvec ros message 
Python :: asyncio wirte to text python 
Python :: python sqlite3 input multiple sql statement 
Python :: concat tensors pytorch 
Python :: python scatter plot 
Python :: convert string representation of dict to dict python 
Python :: decyphing vigener cypher without key 
Python :: pandas filter and change value 
Python :: is int python 
Python :: python json to dict and back 
Python :: erreur install pyaudio 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =