def interp_avg(data_low, data_high, n):
 if isinstance(data_low, (int, long)):
  for i in range(1, n):
   (yield (((data_low * (n - i)) + (data_high * i)) / n))
 else:
  pairs = zip(data_low, data_high)
  pair_iters = [interp_avg(x, y, n) for (x, y) in pairs]
  for i in range(1, n):
   (yield [iter.next() for iter in pair_iters])

def interp_avg ( data_low , data_high , n ) : if isinstance ( data_low , ( int , long ) ) : for i in range ( 1 , n ) : ( yield ( ( ( data_low * ( n - i ) ) + ( data_high * i ) ) / n ) ) else : pairs = zip ( data_low , data_high ) pair_iters = [ interp_avg ( x , y , n ) for ( x , y ) in pairs ] for i in range ( 1 , n ) : ( yield [ iter . next ( ) for iter in pair_iters ] )
interpolated averages .