larray.Array.to_stata

Array.to_stata(filepath_or_buffer, **kwargs) None[source]

Write array to a Stata .dta file.

Parameters
filepath_or_bufferstr or file-like object

Path to .dta file or a file handle.

See also

read_stata

Notes

The round trip to Stata (Array.to_stata followed by read_stata) loose the name of the “column” axis.

Examples

>>> axes = [Axis(3, 'row'), Axis('column=country,sex')]
>>> arr = Array([['BE', 'F'],
...              ['FR', 'M'],
...              ['FR', 'F']], axes=axes)
>>> arr
row*\column  country  sex
          0       BE    F
          1       FR    M
          2       FR    F
>>> arr.to_stata('test.dta')