def interpolate(value_from, value_to, step=10):
 if (type(value_from) in (list, tuple)):
  out = []
  for (x, y) in zip(value_from, value_to):
   out.append(interpolate(x, y, step))
  return out
 else:
  return (value_from + ((value_to - value_from) / float(step)))

def interpolate ( value_from , value_to , step = 10 ) : if ( type ( value_from ) in ( list , tuple ) ) : out = [ ] for ( x , y ) in zip ( value_from , value_to ) : out . append ( interpolate ( x , y , step ) ) return out else : return ( value_from + ( ( value_to - value_from ) / float ( step ) ) )
construct an interpolating polynomial for the data points .