Skip to content

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

Closed
@ghost

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions