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

Conversation

Danferno
Copy link
Contributor

@@ -150,6 +150,7 @@ MultiIndex
I/O
^^^
- :meth:`DataFrame.to_excel` was storing decimals as strings instead of numbers (:issue:`49598`)
- :meth:`DataFrame.to_stata` no longer throws a ``TypeError('encoding without a string argument')`` when exporting a column containing both long strings (Stata strL) and :class:`pd.NA` values (:issue:`23633`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this to v3.0.0.rst?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks

@mroeschke mroeschke added the IO Stata read_stata, to_stata label Apr 14, 2025
Danferno and others added 2 commits April 22, 2025 10:10
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
@mroeschke mroeschke added this to the 3.0 milestone Apr 22, 2025
@mroeschke mroeschke merged commit dd1f69e into pandas-dev:main Apr 22, 2025
42 checks passed
@mroeschke
Copy link
Member

Thanks @Danferno

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO Stata read_stata, to_stata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StataWriter for version 117 fails on None in a string column long enough to be a Stata StrL.
2 participants