def fit(self, X, Y, sample_weight):
    sqrtW = np.sqrt(sample_weight)
    matX = (np.array(X) * sqrtW[:, np.newaxis])
    vecY = (Y * sqrtW)
    self.lsqinfo = np.linalg.lstsq(matX, vecY, rcond=(- 1))
    self.weights = pd.Series(self.lsqinfo[0], index=list(X))
def fit(self, X, Y, sample_weight):
    sqrtW = np.sqrt(sample_weight)
    matX = (np.array(X) * sqrtW[:, np.newaxis])
    vecY = (Y * sqrtW)
    self.lsqinfo = np.linalg.lstsq(matX, vecY, rcond=(- 1))
    self.weights = pd.Series(self.lsqinfo[0], index=list(X))