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

Package up CSV.detect #462

Closed
kescobo opened this issue Jun 20, 2019 · 0 comments · Fixed by #463
Closed

Package up CSV.detect #462

kescobo opened this issue Jun 20, 2019 · 0 comments · Fixed by #463

Comments

@kescobo
Copy link
Contributor

kescobo commented Jun 20, 2019

From discussion on slack, started with me:

Is there a way to tell CSV.read() not to try to unify types for a column? I've got some long form data where the values are a mix of Ints, Floats, and strings. Right now it's just parsing everything as a string and I have to do a second pass to correct everything

@quinnj said:

Ok, so one thing we could do that I've been thinking of doing anyway (since the introduction of the CSV.Rows type) is to package up our CSV.detect machinery so you could just do CSV.detect(str::String), and it would use all the same logic CSV.jl already uses when parsing a file to detect column types. Then you could use CSV.Rows and just call detect to parse the types, or in your case, use CSV.File and apply detect afterwards on the string column. Would you mind opening an issue for this? I don't think it should be too hard to do.

quinnj added a commit that referenced this issue Jun 22, 2019
… useful when using CSV.Rows, or if you have a weird scenario where your column is parsed as a String, but you might want to try to convert them to a value anyway. Closes #462
quinnj added a commit that referenced this issue Jun 22, 2019
… useful when using CSV.Rows, or if you have a weird scenario where your column is parsed as a String, but you might want to try to convert them to a value anyway. Closes #462 (#463)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant