Skip to content

Instantly share code, notes, and snippets.

@anasAlsalol
Created October 29, 2019 14:28
Show Gist options
  • Select an option

  • Save anasAlsalol/6bc7889ca9b03942092fbed56a7055f6 to your computer and use it in GitHub Desktop.

Select an option

Save anasAlsalol/6bc7889ca9b03942092fbed56a7055f6 to your computer and use it in GitHub Desktop.
import math
AbnormalECG = open('AbnormalECG.txt').read().split()
ReferenceECG = open('ReferenceECG.txt').read().split()
sum = 0
for i in range(len(AbnormalECG)):
sum = sum + float(AbnormalECG[i]) * float(ReferenceECG[i])
ex = 0
for i in range(len(AbnormalECG)):
ex = ex + float(AbnormalECG[i]) * float(AbnormalECG[i])
ey = 0
for i in range(len(ReferenceECG)):
ey = ey + float(ReferenceECG[i]) * float(ReferenceECG[i])
final = 1 / (math.sqrt(ey) * math.sqrt(ex) ) * sum
print(final)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment