Skip to content

Data.Analysis : float/double values don't convert properly with . decimals in csv file #5652

Closed
@chriss2401

Description

@chriss2401

If I have a csv dataframe that looks like this:

Date;Value
12-04-1989;20,7
03-11-1990;22,1

Then my two float values will properly be loaded when I call DataFrame.LoadCsv (with values of 20.7 and 22.1)

But if my separator is the default one (',') and my floats are with a dot instead, they will get ignored and I will get 207 and 221 as values.

The issue comes from here :
https://github.com/dotnet/corefxlab/blob/master/src/Microsoft.Data.Analysis/DataFrame.cs#L488

Since if you write object value = Convert.ChangeType("20.7", typeof(double)); you will get 207 as a result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions