You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In most European countries (and elsewhere) the comma is used a decimal delimiter. At the same time the dot is used as a thousands separator. I.e. you see typically numbers in the following form (especially for currency values) :
5.840,72
5.860,72
4.593,58
5.335,72
5.981,53
If you export such numbers from Excel to a CSV file, this exact format is retained. If that CSV file is read by CSV.jl with delim = ',', the values are not recognised as numbers (but as Strings) and you have to manually replace the separators and convert all data to numbers. As this is such a common use case, it is really annoying.
Therefore CSV.jl should act more "intelligent" in this case (like similar CSV-packages in other programming languages do) and recognise these values as numbers, if delim = ',' is used.
The text was updated successfully, but these errors were encountered:
It's not entirely clear what you're proposing be changed; in the example you provided, it seems to me just as likely that the format is american where there are 2 columns, the first being float numbers (5.840) and then a 2nd column of integers (72). How is CSV.jl supposed to be "more intelligent" and know whether things should be interpreted as european vs. american format in this case? Especially when the delimiter is provided as ,, which would suggest 2 columns.
You can provide the decimal and groupmark keyword arguments (which default to . and ,, respectively), to control the parsing of values here.
Ah I see, I should have explained, that in this context (i.e. delim = ',') the field separator is always a semicolon (that's the reason for not using a comma!). That's the 100% standard in Europe and elsewhere (which is also produced by Excel for example). Therefore it would be wonderful to have this situation covered by CVS.jl (I've just tried Kotlin dataframes which have no problems reading CSV-files in this format).
And I've tried now the groupmark-parameter. That's exactly what I've missed.
Perhaps it is just a matter of documentation. It would be helpful to list this common combination (`delim = ';', decimal = ',', groupmark = '.') in the examples section.
In most European countries (and elsewhere) the comma is used a decimal delimiter. At the same time the dot is used as a thousands separator. I.e. you see typically numbers in the following form (especially for currency values) :
5.840,72
5.860,72
4.593,58
5.335,72
5.981,53
If you export such numbers from Excel to a CSV file, this exact format is retained. If that CSV file is read by CSV.jl with
delim = ','
, the values are not recognised as numbers (but as Strings) and you have to manually replace the separators and convert all data to numbers. As this is such a common use case, it is really annoying.Therefore CSV.jl should act more "intelligent" in this case (like similar CSV-packages in other programming languages do) and recognise these values as numbers, if
delim = ','
is used.The text was updated successfully, but these errors were encountered: