def _interpolate(xy, num_points): tck, u = splprep([ xy[:, 0], xy[:, 1]], s=0 ) unew = linspace(0, 1, num_points) out = splev(unew, tck) return column_stack(out)