8000 ENH: Update DataFrame.to_stata to handle pd.NA and None values in strL columns by Danferno · Pull Request #61286 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

ENH: Update DataFrame.to_stata to handle pd.NA and None values in strL columns #61286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 22, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update pandas/io/stata.py
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
  • Loading branch information
Danferno and mroeschke authored Apr 22, 2025
commit 92ed281fa43b3490f4f30cd7fd9a79dfd1da5f24
2 changes: 1 addition & 1 deletion pandas/io/stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -3197,7 +3197,7 @@ def generate_table(self) -> tuple[dict[str, tuple[int, int]], DataFrame]:
for j, (col, v) in enumerate(col_index):
val = row[col]
# Allow columns with mixed str and None or pd.NA (GH 23633)
val = "" if (val is None) or isna(val) else val
val = "" if isna(val) else val
key = gso_table.get(val, None)
if key is None:
# Stata prefers human numbers
Expand Down
Loading
0