code: def data2proddummy(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 possible
      groups = np.unique(lmap(tuple, x.tolist()))
      # includes singularity with additive factors
      return (x == groups[:, None, :]).all(-1).T.astype(int)[:, :-1]
  
file_path: statsmodels/statsmodels/sandbox/regression/ols_anova_original.py
imports: import numpy
  import numpy.lib.recfunctions
  from statsmodels.compat.python import lmap
  from statsmodels.regression.linear_model import OLS
label_desc: Use image node_id 2 for calling a global function with example usage: data2proddummy(x) and returns: unknown