TypeError Traceback (most recent call last)
in
----> 1 weights_date_rank = np.polyfit(RankData.Date, RankData.Rank, 3)
2 model_date_rank = np.poly1d(weights_date_rank)
3 preds_rank = np.round(model_date_rank(RankData.Date))
4 preds_rank[preds_rank<1] = 1
c:\program files\python37\lib\site-packages\numpy\lib\polynomial.py in polyfit(x, y, deg, rcond, full, w, cov)
626 scale = NX.sqrt((lhs*lhs).sum(axis=0))
627 lhs /= scale
--> 628 c, resids, rank, s = lstsq(lhs, rhs, rcond)
629 c = (c.T/scale).T # broadcast scale coefficients
630
c:\program files\python37\lib\site-packages\numpy\linalg\linalg.py in lstsq(a, b, rcond)
2234 # lapack can't handle n_rhs = 0 - so allocate the array one larger in that axis
2235 b = zeros(b.shape[:-2] + (m, n_rhs + 1), dtype=b.dtype)
-> 2236 x, resids, rank, s = gufunc(a, b, rcond, signature=signature, extobj=extobj)
2237 if m == 0:
2238 x[...] = 0
TypeError: No loop matching the specified signature and casting
was found for ufunc lstsq_n
TypeError Traceback (most recent call last)
in
----> 1 weights_date_rank = np.polyfit(RankData.Date, RankData.Rank, 3)
2 model_date_rank = np.poly1d(weights_date_rank)
3 preds_rank = np.round(model_date_rank(RankData.Date))
4 preds_rank[preds_rank<1] = 1
c:\program files\python37\lib\site-packages\numpy\lib\polynomial.py in polyfit(x, y, deg, rcond, full, w, cov)
626 scale = NX.sqrt((lhs*lhs).sum(axis=0))
627 lhs /= scale
--> 628 c, resids, rank, s = lstsq(lhs, rhs, rcond)
629 c = (c.T/scale).T # broadcast scale coefficients
630
c:\program files\python37\lib\site-packages\numpy\linalg\linalg.py in lstsq(a, b, rcond)
2234 # lapack can't handle n_rhs = 0 - so allocate the array one larger in that axis
2235 b = zeros(b.shape[:-2] + (m, n_rhs + 1), dtype=b.dtype)
-> 2236 x, resids, rank, s = gufunc(a, b, rcond, signature=signature, extobj=extobj)
2237 if m == 0:
2238 x[...] = 0
TypeError: No loop matching the specified signature and casting
was found for ufunc lstsq_n