Weighted Least Squares Python