New behaviour due to an update of the package CSV when using CSV.write


When I use the code

using CSV
using DataFrames
df=DataFrame([Float64 for k in 1:1],[Symbol("ps_prev_$k") for k in 1:1],0);
CSV.write("tmp.csv",df,delim=';', append=true, writeheader=false);

on JuliaBox, the file tmp.csv contains 1000.0 which is what I want.

Nevertheless, on my Linux distribution, the file tmp.csv contains 1e3 which is NOT what I would like for this csv output. Before the updating of the CSV and DataFrames packages, the behaviour was as on JuliaBox.

Is-it due to the new version of the CSV package ? If it is the case, could you tell me how to recover 1000.0 instead of 1e3 in the tmp.csv file by using the previous code ? Thanks very much !


The version of the CSV package is:
CSV v0.4.3 on JuliaBox ;
CSV v0.5.9 on my Linux distribution.

The version of the DataFrames package is:
DataFranes v0.17.1 on JuliaBox ;
DataFrames v0.19.0 on my Linux distribution.

I find some expression here very hacky, e.g:

[Float64 for k in 1:1]

what is the goal here?

This code comes from a more complexe code. This part of the code is OK.

The goal here is just to put the float 1000.0 in the DataFrame df. My problem is just with the CSV output and thus with the new CSV.write function (because of the updating of the CSV package ?), not with the DataFrame in my opinion.

1 Like

As a workaround, you can add a specific version of CSV for both manifests, and perhaps pin it so it is not updated accidentally.

Cf the discussion at

I could not find an open issue at CSV.jl, which would be the first step towards changing this (or allowing it to be customized).

Thanks for this info… Could you tell me how I can come back to CSV v0.4.3 knowing that I have updated to CSV v0.5.9 ?

Could you also tell me how we can block an updating to avoid some regression as much as we can (ie before having validated a new package with non-regression tests) ?

Thanks very much !

These are precisely the two things I linked above.

Oups … sorry … . It is the morning … . I did not see the hyperlink add and pin. I will try this afternoon.

1 Like

I found this basic solution for my problem (but not really “smart”):

using CSV
using DataFrames
df2=DataFrame([String for k in 1:1],[Symbol("ps_prev_$k") for k in 1:1],0);
CSV.write("tmp2.csv",df2,delim=';', append=true, writeheader=false);

This also works for the case indicated in CSV ruins scientific notation (identical behaviour and result OK by changing the value of x above)