def _dtype_to_stata_type(dtype, column):
<EOL>if dtype.type == np.object_:  <EOL><INDENT>itemsize = max_len_string_array(ensure_object(column.values))<EOL>return max(itemsize, <NUM_LIT:1>)<EOL><DEDENT>elif dtype == np.float64:<EOL><INDENT>return <NUM_LIT:255><EOL><DEDENT>elif dtype == np.float32:<EOL><INDENT>return <NUM_LIT><EOL><DEDENT>elif dtype == np.int32:<EOL><INDENT>return <NUM_LIT><EOL><DEDENT>elif dtype == np.int16:<EOL><INDENT>return <NUM_LIT><EOL><DEDENT>elif dtype == np.int8:<EOL><INDENT>return <NUM_LIT><EOL><DEDENT>else:  <EOL><INDENT>raise NotImplementedError(<EOL>"<STR_LIT>".format(dtype=dtype))<EOL><DEDENT>
Convert dtype types to stata types. Returns the byte of the given ordinal.
See TYPE_MAP and comments for an explanation. This is also explained in
the dta spec.
1 - 244 are strings of this length
                     Pandas    Stata
251 - for int8      byte
252 - for int16     int
253 - for int32     long
254 - for float32   float
255 - for double    double

If there are dates to convert, then dtype will already have the correct
type inserted.