SHARE
TWEET

Untitled

a guest Apr 17th, 2019 111 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pole  = [0,0.1,0.2,0.3,0.4,0.5,0.6,1,2,3,4,5,-1]
  2.  
  3. def HardClipper(pole):
  4.     vstup = pole
  5.     vystup = vstup.copy()
  6.  
  7.     for i in range(len(vstup)):
  8.         if (vstup[i] >= 0.5):
  9.             vystup[i] = 0.5
  10.         elif (vstup[i] <= -0.5):
  11.             vystup[i] = -0.5
  12.         else:
  13.             vystup[i] = vstup[i]
  14.     return [vystup[i] for i in range(len(vstup))]
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21. pole2 = HardClipper(pole)
  22.  
  23. print(pole)
  24. print(pole2)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top