def guess_plateau(x, y):
 if (len(x) != len(y)):
  return 0
 diffs = []
 indexes = range(len(y))
 for i in indexes:
  if ((i + 1) not in indexes):
   continue
  diffs.append((y[(i + 1)] - y[i]))
 diffs = np.array(diffs)
 ymax = y[(-1)]
 for i in indexes:
  if ((y[i] > (ymax - diffs.std())) and (y[i] < (ymax + diffs.std()))):
   ymax = y[i]
   break
 return ymax

def guess_plateau ( x , y ) : if ( len ( x ) != len ( y ) ) : return 0 diffs = [ ] indexes = range ( len ( y ) ) for i in indexes : if ( ( i + 1 ) not in indexes ) : continue diffs . append ( ( y [ ( i + 1 ) ] - y [ i ] ) ) diffs = np . array ( diffs ) ymax = y [ ( - 1 ) ] for i in indexes : if ( ( y [ i ] > ( ymax - diffs . std ( ) ) ) and ( y [ i ] < ( ymax + diffs . std ( ) ) ) ) : ymax = y [ i ] break return ymax
given two axes returns a guess of the plateau point .