ENH: Add categorical support for Stata export

Add support for exporting DataFrames containing categorical data.

closes #8633
xref #7621 
String representations could conflict with either each other,  if two objects have the same str, or a stringified value could conflict with an existing cat label.  For example,  if categorical labels contained 1 and "1" .

On Nov 10, 2014 7:19 PM, Joris Van den Bossche <notifications@github.com> wrote:

In pandas/io/stata.py:

> @@ -336,6 +336,15 @@ class PossiblePrecisionLoss(Warning):
>  conversion range. This may result in a loss of precision in the saved data.
>  """
>
> +class ValueLabelTypeMismatch(Warning):
> +    pass
> +
> +value_label_mismatch_doc = """
> +Stata value labels (pandas categories) must be strings. Column {0} contains
> +non-string labels which will be converted to strings.  Please check that the
> +Stata data file created has not lost information due to duplicate labels.


What is the connection between the need for checking for duplicate data and the fact that the labels are stringified?

—
Reply to this email directly or view it on GitHub<https://github.com/pydata/pandas/pull/8767/files#r20104986>.