docstr: Write some data to a csv file.  Only use for debugging!
docstr_tok: ["Write","some","data","to","a","csv","file",".","Only","use","for","debugging","!"]
code: def write2file(self, file_name, data):  # pragma: no cover
      """Write some data to a csv file.  Only use for debugging!"""
      import csv
  
      data_file = csv.writer(open(file_name, "w", encoding="utf-8"))
      data = np.column_stack(data)
      nobs = max(np.shape(data))
      K = min(np.shape(data))
      data = np.reshape(data, (nobs, K))
      for i in range(nobs):
          data_file.writerow(list(data[i, :]))
  
imports: import pytest
  import numpy
  import numpy.testing
  import statsmodels.api
label_desc: Use image node_id 2 for calling the KernelRegressionTestBase obj's underlying member method code with example usage: obj.write2file(file_name, data) without return types