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

read_csv treats both inf and -inf as very large negative number #2041

Closed
lodagro opened this issue Oct 8, 2012 · 3 comments
Closed

read_csv treats both inf and -inf as very large negative number #2041

lodagro opened this issue Oct 8, 2012 · 3 comments
Labels
Milestone

Comments

@lodagro
Copy link
Contributor

lodagro commented Oct 8, 2012

from mailing list, same discussion led to #2026

In [42]: data = """\
   ....: ,A
   ....: a,inf
   ....: b,-inf
   ....: """

In [43]: df = pd.read_csv(StringIO(data), index_col=0)

In [44]: df
Out[44]: 
                     A
a -9223372036854775808
b -9223372036854775808

In [45]: df.dtypes
Out[45]: A    int64
@aflaxman
Copy link
Contributor

aflaxman commented Oct 8, 2012

Here is a test and a patch for this bug: aflaxman@d11eea2

I'm planning to make a pull request which combines it with work on #2026 and #1919.

@aflaxman aflaxman mentioned this issue Oct 9, 2012
@wesm wesm closed this as completed in 396c3ab Nov 1, 2012
@wesm
Copy link
Member

wesm commented Nov 1, 2012

I added a workaround the inf/-inf parsing issue with something with a bit less overhead (fewer string comparisons). I'll address the other PR's separately

@aflaxman
Copy link
Contributor

aflaxman commented Nov 1, 2012

thanks!

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

3 participants