statsmodels/statsmodels — pull request #526 by jseabold (2012-10-08 05:27:14+00:00)
Title: ENH: Add class to write Stata binary dta files

This needs a little polishing but works for now for the below simple case. Should round trip the same.

```
dta = sm.datasets.macrodata.load().data
dtype = dta.dtype
dta = dta.astype(np.dtype([('year', 'i8'),('quarter', 'i4')] + dtype.descr[2:]))
writer = StataWriter("./try_dta.dta", dta)
writer.write_file()
dta2 = genfromdta('./try_dta.dta')
```

TODO:
* Docstrings
* Test on Python 3
* Test with different encoding for strings - not handled yet
* Test with object arrays
* Test with datetime types - will need to convert to Stata time integer
* Add support for pandas objects