Advertisement
MagicWinnie

4 Tests

Dec 1st, 2018
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. import matplotlib as mpl
  2. from scipy.signal import lfilter
  3. r = list(map(float, input().split(" ") ))
  4. n = 0
  5. z = 0
  6. x = []
  7. n = 10 # the larger n is, the smoother curve will be
  8. b = [1.0 / n] * n
  9. a = 1
  10. yy = lfilter(b,a,r)
  11. yy=list(map(float, yy))
  12. for i in range(len(yy)):
  13.     if (z > 0):
  14.         z = z - 1
  15.     elif ((yy[i] > 0.3) and (yy[i + 1] < 0.3) or (yy[i] == 0.3) and (yy[i + 1] < 0.3) ):
  16.         n = n + 1
  17.         z = 210
  18. print(abs(10-n))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement