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

DataFrame to_csv() ignores nanRep argument for float32 input #182

Closed
scottza opened this issue Sep 28, 2011 · 2 comments

Comments

@scottza
Copy link

commented Sep 28, 2011

import numpy as np
import pandas

d = np.random.randn(8, 4)
df = pandas.DataFrame(d)
df[1][:] = np.nan
df.to_csv('pandas-success.csv', nanRep='999')

d = np.asarray(np.random.randn(8, 4), dtype=np.float32)
df = pandas.DataFrame(d)
df[1][:] = np.nan
df.to_csv('pandas-fail.csv', nanRep='999')

After running this with pandas 0.4.1 the file pandas-success.csv
contains the nanRep string '999' as defined, but the file
pandas-fail.csv contains the string 'nan' instead.

@wesm

This comment has been minimized.

Copy link
Member

commented Oct 1, 2011

Fixed in the above commit. Will be part of the forthcoming 0.4.2 release

@wesm wesm closed this Oct 1, 2011

@scottza

This comment has been minimized.

Copy link
Author

commented Oct 2, 2011

Thanks!
On Oct 1, 2011 9:24 PM, "Wes McKinney" <
reply@reply.github.com>
wrote:

Fixed in the above commit. Will be part of the forthcoming 0.4.2 release

Reply to this email directly or view it on GitHub:
https://github.com/wesm/pandas/issues/182#issuecomment-2258447

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.