Skip to content

Narrow column type #138

Open
Open
@cmcaine

Description

@cmcaine

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}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions