""" Construct normal probability plot """ import math import scipy.stats as ss import numpy as np import matplotlib.pyplot as plt import seaborn as sns import prettytable from random import seed seed(100) ################ mu = 0.0 sigma = 1.0 x = np.linspace(mu - 5*sigma, mu + 5*sigma, 10) norm_pdf_x= ss.norm.pdf(x,mu,sigma) plt.plot(x,norm_pdf_x) print("The Std. Dev. of normally Dist. x =", np.std(norm_pdf_x)) print() ######------Second Method-----###### """ #####--- x Values are derived from the first program----#### # Plot between -10 and 10 with .001 steps. #x_axis = np.arange(-10, 10, 0.001) Mean = 1.0 SD = 1. #plt.plot(x, ss.norm.pdf(x,Mean,SD)) """ #####---- X Values Come From The First Program ----######################### print("Type x =", type(x)) x_list = x.tolist() print(type(x_list)) x_s = np.sort(x_list) mean_x = np.mean(x_s) std_x = np.std(x_s) print("The Std. Dev. of sorted x =", std_x) print() print("The Standard Deviation of the Normal Data =", sigma) print() print("The mean of sorted x =",mean_x) p = x_s/len(x_s) #####----------Calculate the normal distribution of p----### #pdf_x_s = ss.norm.pdf(x_s,mean_x,std_x) #z = (x_s - mean_x)/std_x #plt.plot(norm_pdf_x,z) #plt.plot(p,z) ########################################################### #from tabulate import tabulate #print(tabulate([['Alice', 24], ['Bob', 19]], headers = ['Name', 'Age'], tablefmt='orgtable')) ############################################################ from prettytable import PrettyTable t = PrettyTable(['i', 'x_sorted']) print(t) plt.show()