Skip to content
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

[SPARK-46955][PS] Implement Frame.to_stata #44996

Closed
wants to merge 1 commit into from

Conversation

zhengruifeng
Copy link
Contributor

What changes were proposed in this pull request?

Implement Frame.to_stata

Why are the changes needed?

for Pandas parity

Does this PR introduce any user-facing change?

yes

In [5]: df = pd.DataFrame({'animal': ['falcon', 'parrot', 'falcon', 'parrot'], 'speed': [350, 18, 361, 15]})

In [6]: psdf = ps.from_pandas(df)

In [7]: df.to_stata('/tmp/animals_1.dta')

In [8]: psdf.to_stata('/tmp/animals_2.dta')

In [9]: pd.read_stata('/tmp/animals_1.dta')
Out[9]:
   index  animal  speed
0      0  falcon    350
1      1  parrot     18
2      2  falcon    361
3      3  parrot     15

In [10]: pd.read_stata('/tmp/animals_2.dta')
Out[10]:
   index  animal  speed
0      0  falcon    350
1      1  parrot     18
2      2  falcon    361
3      3  parrot     15

How was this patch tested?

added ut

Was this patch authored or co-authored using generative AI tooling?

no

@zhengruifeng
Copy link
Contributor Author

merged to master

@zhengruifeng zhengruifeng deleted the ps_to_stata branch February 5, 2024 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants