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

Narrow column type #138

Open
cmcaine opened this issue Jul 24, 2019 · 0 comments
Open

Narrow column type #138

cmcaine opened this issue Jul 24, 2019 · 0 comments

Comments

@cmcaine
Copy link

cmcaine commented Jul 24, 2019

Related to #64

If you read a csv with a column that is initially empty, TextParse.jl assigns that column a type of Any. I propose that the column type should either be narrowed to a union of the actual types used or that the initial type should be Missing and it should be promoted as in #64.

Complete example

IOBuffer("""
floatcol,mostlymissingcol
-1.,
-1.,
-1.,
-1.,
-1.,
-1.,
-1.,
-1.,
-1.,
-1.,
-1.,
-1.,
-1.,
-1.,
-1.,
-1.,
-1.,
-1.,
-1.,
-1.,
-1.,10.
""") |> TextParse.csvread |> typeof

# Returns
# Tuple{Tuple{Array{Float64,1},Array{Any,1}},Array{String,1}}
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

No branches or pull requests

1 participant