string, path object (pathlib.Path or py._path.local.LocalPath) or object implementing a binary write() functions. If using a buffer then the buffer will not be automatically closed after the file is written.
Input to save
Dictionary mapping columns containing datetime types to stata internal format to use when writing the dates. Options are 'tc', 'td', 'tm', 'tw', 'th', 'tq', 'ty'. Column can be either an integer or a name. Datetime columns that do not have a conversion type specified will be converted to 'tc'. Raises NotImplementedError if a datetime column has timezone information
Write the index to Stata dataset.
Can be ">", "<", "little", or "big". default is :None:None:`sys.byteorder`
A datetime to use as file creation date. Default is the current time
A label for the data set. Must be 80 characters or smaller.
Dictionary containing columns as keys and variable labels as values. Each label must be 80 characters or smaller.
List of columns names to convert to Stata StrL format. Columns with more than 2045 characters are automatically written as StrL. Smaller columns can be converted by including the column name. Using StrLs can reduce output file size when strings are longer than 8 characters, and either frequently repeated or sparse.
Dictionary containing columns as keys and dictionaries of column value to labels as values. The combined length of all labels for a single variable must be 32,000 characters or smaller.
If datetimes contain timezone information
Columns listed in convert_dates are neither datetime64[ns] or datetime.datetime
Column dtype is not representable in Stata
Column listed in convert_dates is not in DataFrame
Categorical label contains more than 32,000 characters
The StataWriter117 instance has a write_file method, which will write the file to the given :None:None:`fname`
.
A class for writing Stata binary dta files in Stata 13 format (117)
>>> from pandas.io.stata import StataWriter117
... data = pd.DataFrame([[1.0, 1, 'a']], columns=['a', 'b', 'c'])
... writer = StataWriter117('./data_file.dta', data)
... writer.write_file()
Directly write a zip file >>> compression = {"method": "zip", "archive_name": "data_file.dta"} >>> writer = StataWriter117('./data_file.zip', data, compression=compression) >>> writer.write_file()
Or with long strings stored in strl format >>> data = pd.DataFrame([['A relatively long string'], [''], ['']], ... columns=['strls']) >>> writer = StataWriter117('./data_file_with_long_strings.dta', data, ... convert_strl=['strls']) >>> writer.write_file()
See :The following pages refer to to this document either explicitly or contain code examples using this.
pandas.core.frame.DataFrame.to_stata
pandas.io.stata.StataWriter117
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them