def polyfit( (xvec, yvec), degree=2 ):
    return Mat([ [x**n for n in range(degree,-1,-1)] for x in xvec ]).solve(Vec(yvec))
Solves Vandermonde design matrix for approximating polynomial coefficients
dataset/ETHPy150Open sunlightlabs/clearspending/completeness/statlib/matfunc.py/polyfit