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
Closed

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

scottza opened this issue Sep 28, 2011 · 2 comments
Labels
Milestone

Comments

@scottza
Copy link

scottza 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
Copy link
Member

wesm commented Oct 1, 2011

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

@wesm wesm closed this as completed Oct 1, 2011
@scottza
Copy link
Author

scottza 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

dan-nadler pushed a commit to dan-nadler/pandas that referenced this issue Sep 23, 2019
- new serializer for ChunkStore
- supports by column serialization
- Significantly faster than the record serializer for this use case
- Supports DataFrames and Series only
- Changes to chunker that boost performance
- Ability to read subset of columns
- Also fixes pandas-dev#164
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants