1# import required libraries
2from scipy.stats import norm
3import numpy as np
4import matplotlib.pyplot as plt
5import seaborn as sb
6
7# Creating the distribution
8data = np.arange(1,10,0.01)
9pdf = norm.pdf(data , loc = 5.3 , scale = 1 )
10
11#Visualizing the distribution
12
13sb.set_style('whitegrid')
14sb.lineplot(data, pdf , color = 'black')
15plt.xlabel('Heights')
16plt.ylabel('Probability Density')
17
1#calculating the probability or the area under curve to the left of this z value
2import scipy.stats as stats
3stats.norm.pdf(x, loc=mean, scale=std_dev)
4
5
6
7
8# The probability (area) to the right is calculated as (1 - probability to the left)
9import scipy.stats as stats
101 - stats.norm.pdf(x, loc=mean, scale=std_dev)