Skip to content

Instantly share code, notes, and snippets.

@tavuong
Last active June 18, 2020 12:29
Show Gist options
  • Save tavuong/fc9aa46f1eeaed95063ee5b622829c9b to your computer and use it in GitHub Desktop.
Save tavuong/fc9aa46f1eeaed95063ee5b622829c9b to your computer and use it in GitHub Desktop.
Normalize Summe function for Covid19-data
def ta_vuong_norm_s (y):
# Covid19 _VuongSimulator
# ---- VUONG-Aligorithm: Normalyse Summe function
# Author: Dr. The Anh Vuong
# (c) 2020 by Dr.-The Anh Vuong
# Licence: MIT , Patent right is reserved
#--------------------------------------------------
# y: input
# y3 = ta_norm : calculead output
# y3 generated
y3 = []
k = 0
for k in y:
y3.append(0.0)
#------ y3 = Acummulated y []---
k = 0
summe = 0
for i in y:
summe = y[k] + summe
y3[k] = summe
k = k+1
#------- Maximal search --------
y3np = np.matrix(y3)
y3max = y3np.max()
summe = y3max
k = 0
ywert = 0.0
for i in y:
ywert = y [k]
y3[k] = 100.0*ywert/summe
k = k+1
return y3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment