(x)
| 89 | |
| 90 | |
| 91 | def f(x): |
| 92 | n = x.shape[0] |
| 93 | g2 = x.group2 |
| 94 | u = g2.unique() |
| 95 | u.sort() |
| 96 | uv = {v: k for k, v in enumerate(u)} |
| 97 | mat = np.zeros((n, len(u))) |
| 98 | for i in range(n): |
| 99 | mat[i, uv[g2.iloc[i]]] = 1 |
| 100 | colnames = ["%d" % z for z in u] |
| 101 | return mat, colnames |
| 102 | |
| 103 | |
| 104 | # Then we set up the variance components using the VCSpec class. |
no test coverage detected