def PercentileRows(ys_seq, percents):
 nrows = len(ys_seq)
 ncols = len(ys_seq[0])
 array = np.zeros((nrows, ncols))
 for (i, ys) in enumerate(ys_seq):
  array[(i,)] = ys
 array = np.sort(array, axis=0)
 rows = [PercentileRow(array, p) for p in percents]
 return rows

def PercentileRows ( ys_seq , percents ) : nrows = len ( ys_seq ) ncols = len ( ys_seq [ 0 ] ) array = np . zeros ( ( nrows , ncols ) ) for ( i , ys ) in enumerate ( ys_seq ) : array [ ( i , ) ] = ys array = np . sort ( array , axis = 0 ) rows = [ PercentileRow ( array , p ) for p in percents ] return rows
given a collection of lines .