Skip to content

Commit 90c0a5f

Browse files
committed
ENH: Add StataWriter 118 for unicode support
Add StataWriter with unicode support
1 parent 37dfcc1 commit 90c0a5f

File tree

3 files changed

+266
-76
lines changed

3 files changed

+266
-76
lines changed

pandas/core/frame.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,14 +1915,17 @@ def to_stata(
19151915
>>> df.to_stata('animals.dta') # doctest: +SKIP
19161916
"""
19171917
kwargs = {}
1918-
if version not in (114, 117):
1918+
if version not in (114, 117, 118):
19191919
raise ValueError("Only formats 114 and 117 supported.")
19201920
if version == 114:
19211921
if convert_strl is not None:
19221922
raise ValueError("strl support is only available when using format 117")
19231923
from pandas.io.stata import StataWriter as statawriter
19241924
else:
1925-
from pandas.io.stata import StataWriter117 as statawriter
1925+
if version == 117:
1926+
from pandas.io.stata import StataWriter117 as statawriter
1927+
else:
1928+
from pandas.io.stata import StataWriter118 as statawriter
19261929

19271930
kwargs["convert_strl"] = convert_strl
19281931

0 commit comments

Comments
 (0)