chore: polish print statements

This commit is contained in:
surtur 2022-11-17 21:58:15 +01:00
parent 641eec0846
commit 18e0b59d2e
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI

@ -26,7 +26,7 @@ def main(argv):
# d = f.load_d("./dat.csv") # d = f.load_d("./dat.csv")
d = f.load_d(inputfile) d = f.load_d(inputfile)
# d = d.astype('float64') # d = d.astype('float64')
print(d.head()) print(d.head(), '\n')
# data plots # data plots
du = d['u'] du = d['u']
@ -37,9 +37,13 @@ def main(argv):
# mean and variance # mean and variance
mean_u = f.mean(d['u']) mean_u = f.mean(d['u'])
mean_y = f.mean(d['y']) mean_y = f.mean(d['y'])
print('mean u:', mean_u)
print('mean y:', mean_y)
variance_u = f.variance(d['u']) variance_u = f.variance(d['u'])
variance_y = f.variance(d['y']) variance_y = f.variance(d['y'])
print('variance u:', variance_u)
print('variance y:', variance_y)
hist_u = f.histogram(d['u'], fname='u_hist') hist_u = f.histogram(d['u'], fname='u_hist')
hist_y = f.histogram(d['y'], fname='y_hist', colour='green') hist_y = f.histogram(d['y'], fname='y_hist', colour='green')
@ -52,6 +56,7 @@ def main(argv):
std_dev_y = f.std_dev(d['y']) std_dev_y = f.std_dev(d['y'])
# correlation coefficient # correlation coefficient
correl_c = f.correl_coeff(cov, std_dev_u, std_dev_y) correl_c = f.correl_coeff(cov, std_dev_u, std_dev_y)
print("correlation coefficient:", correl_c)
print("covariance matrix (built-in):\n", d.cov()) print("covariance matrix (built-in):\n", d.cov())
# print the covariance matrix. # print the covariance matrix.