title: Fastest way to find maximum value of a list in specific intervals
body: <p>I have a list that contains 1024 elements. I want to check the maximum value of the list between an interval that i determined.</p>
  
  <p>for example X is my list that is in numpy array form. Then;</p>
  
  <pre><code>if np.amax(X[0:31]) &gt; 200:
      print("1")
  elif np.amax(X[0:31]) &lt; 200:
      print("1a")
  
  if np.amax(X[32:63] &gt; 200:
      print("2")
  elif np.amax(X[32:63] &lt; 200:
      print("2a")
  </code></pre>
  
  <p>and if - elif statements goes untill X[992:1023]. That means there are 16 intervals and 16 if-elif statements. Is there more efficient way to do that? </p>
  
  <p>edit:Thanks for the answer. But the problem is a bit different. Let me try to explain it with an example. Each result of these intervals lights up an LED. There are 16 intervals and 16 different LEDs. Further more maximum value bounds have 3 layer. I did not mention about it. But such as (max&lt;200), (200>max&lt;500), (max > 500). It is a bit complicated.</p>