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

API: pandas.read_table should handle Inf the same way as inf #4219

Closed
aebrahim opened this issue Jul 11, 2013 · 4 comments · Fixed by #4220
Closed

API: pandas.read_table should handle Inf the same way as inf #4219

aebrahim opened this issue Jul 11, 2013 · 4 comments · Fixed by #4220
Labels
API Design IO CSV read_csv, to_csv
Milestone

Comments

@aebrahim
Copy link

entries with "Inf" (beginning with upper case I) will assign that column a dtype of object while "inf" is parsed as infinity.

I believe that in R, the function write.table uses "Inf" (with the uppercase) which would make importing tables exported from R more difficult.

@jreback
Copy link
Contributor

jreback commented Jul 11, 2013

pretty straightforward to amend this work

@jtratner
Copy link
Contributor

@jreback I'll have a PR soon. Pretty minimal change, esp if just special case it. Much slower if pass a list and then use the in operator.

@jreback
Copy link
Contributor

jreback commented Jul 12, 2013

no this is just a really small change in src/parser.pyx

it string matches inf and -inf using strcmp

just need to do this ignoring case

@jreback
Copy link
Contributor

jreback commented Jul 12, 2013

could prob just change strcmp to strcasecmp

and add a test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design IO CSV read_csv, to_csv
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants