def ratval( self, x ):
        degree = len(self) / 2
        num, den = self[:degree+1], self[degree+1:] + [1]
        return num.polyval(x) / den.polyval(x)
Vec([10,20,30,40,50]).ratfit(5) evaluates to (10*x**2 + 20*x + 30) / (40*x**2 + 50*x + 1) at x=5.
dataset/ETHPy150Open sunlightlabs/clearspending/completeness/statlib/matfunc.py/Vec.ratval