def test_stata_writer_array():
    buf = BytesIO()
    dta = macrodata.load().data
    dta = DataFrame.from_records(dta)
    dta.columns = [i % "v%d" for i in range(1,15)]
    writer = StataWriter(buf, dta.values)
    writer.write_file()
    buf.seek(0)
    dta2 = genfromdta(buf)
    dta = dta.to_records(index=False)
    assert_array_equal(dta, dta2)
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/iolib/tests/test_foreign.py/test_stata_writer_array/swapped operands of `%`