Skip to content

Unexpected in-place changes when saving a DataFrame to Stata with write_index=False #9795

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

Closed
ghost opened this issue Apr 2, 2015 · 1 comment
Labels
Bug IO Stata read_stata, to_stata
Milestone

Comments

@ghost
Copy link

ghost commented Apr 2, 2015

After executing df.to_stata() with write_index=False, all NaNs in df were automatically replaced by 8.988466e+307. Please see the following code:

df = pd.DataFrame(np.random.randn(5,4), columns=list('abcd'))
df.ix[2, 'a':'c'] = np.nan
print df
df.to_stata('test.dta', write_index=False)
print df
I am using pandas v0.16.0. Thanks.

@jreback jreback added Bug IO Stata read_stata, to_stata labels Apr 3, 2015
@jreback
Copy link
Contributor

jreback commented Apr 3, 2015

cc @bashtage
cc @kshedden

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

Successfully merging a pull request may close this issue.

1 participant