Skip to content

Commit 485e7ca

Browse files
committed
StataMissingValue expects value passed in to be of float type, so cast to this
1 parent 796ce59 commit 485e7ca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/io/stata.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1848,7 +1848,9 @@ def _do_convert_missing(self, data: DataFrame, convert_missing: bool) -> DataFra
18481848
replacement = Series(series, dtype=object)
18491849
for j, um in enumerate(umissing):
18501850
if self._format_version <= 111:
1851-
missing_value = StataMissingValue(self.MISSING_VALUES[fmt])
1851+
missing_value = StataMissingValue(
1852+
float(self.MISSING_VALUES[fmt])
1853+
)
18521854
else:
18531855
missing_value = StataMissingValue(um)
18541856

0 commit comments

Comments
 (0)