def generate_patch_base(x, y, base=0.0):
 x = x.values
 y = y.values
 y0 = np.insert(y, 0, base)
 y0 = np.append(y0, base)
 x0 = np.insert(x, 0, x[0])
 x0 = np.append(x0, x0[(-1)])
 return (x0, y0)

def generate_patch_base ( x , y , base = 0.0 ) : x = x . values y = y . values y0 = np . insert ( y , 0 , base ) y0 = np . append ( y0 , base ) x0 = np . insert ( x , 0 , x [ 0 ] ) x0 = np . append ( x0 , x0 [ ( - 1 ) ] ) return ( x0 , y0 )
adds base to the start and end of y .