Skip to content

weird typemap behavior (bug?) #680

@kragol

Description

@kragol

The typemap option to CSV.File produces incorrect types when mapping Integer types (I haven't really tested other types though). Basically, all Int columns are converted to Float64 whatever the typemap indicates as a target type.

MWE:
file test.csv:

"a","b","c"
1,"a",12
1,"a",12
julia> CSV.File("test.csv"),typemap=Dict(Int64=>Int32))
2-element CSV.File{false}:
 CSV.Row: (a = 1.0, b = "a", c = 12.0)
 CSV.Row: (a = 1.0, b = "a", c = 12.0)

Here, the values of a and c are converted to Float64 instead of Int32 as requested.

julia 1.4.2
CSV 0.7.2

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