title: Find Inflection and Stationary points in a numpy 1d-array
body: <p>Lets assume I have the following numpy array:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  x = np.array([11.53333333, 11.86666667, 11.1, 10.66666667, 11.2, 11.3,
                11.06666667, 12.06666667, 11.8, 13.03333333, 12.4,
                12.33333333, 12.53333333, 13.33333333, 12.43333333, 13., 13.2,
                13.76666667, 14.96666667, 19.16666667, 25.1, 32.,
                83.33333333, 103.76666667, 110.7, 118.63333333, 129.26666667,
                139.06666667, 150.3, 161.53333333, 171.16666667, 184.56666667,
                196.6, 210.26666667, 221.63333333, 231.3, 244.16666667,
                253.5, 254.66666667, 255., 255., 255., 255.,
                255., 255., 255., 255., 255., 255.,
                255., 255., 255., 255., 255., 255.,
                255., 255., 255., 255., 255.])
  
  plt.plot(x)
  plt.show()
  </code></pre>
  
  <p>Here's the plotted output:</p>
  
  <p><img src="https://i.stack.imgur.com/ew7qL.jpg" alt="plotted x"></p>
  
  <p>How can I easily get the turning points in this graph? For example the first turning point is round about at x=20, another one at 
  x=37.</p>
  
  <p>Is it possible to get all turning points in an descending order, so I can afterwards grab the 3 most destinctive turning points?</p>
  
  <hr>
  
  <p><strong>Update:</strong>
  I am interested in getting the <a href="https://en.wikipedia.org/wiki/Inflection_point" rel="nofollow noreferrer">Inflection Points</a> as well as the <a href="https://en.wikipedia.org/wiki/Stationary_point" rel="nofollow noreferrer">Stationary points</a>. Is there a simple solution in numpy / scipy?</p>