[docs]defdata2proddummy(x):'''creates product dummy variables from 2 columns of 2d array drops last dummy variable, but not from each category singular with simple dummy variable but not with constant quickly written, no safeguards '''#brute force, assumes x is 2d#replace with encoding if possiblegroups=np.unique(lmap(tuple,x.tolist()))#includes singularity with additive factorsreturn(x==groups[:,None,:]).all(-1).T.astype(int)[:,:-1]