Write CSV with nulls from dataframe



I’m trying to write a CSV file using the CSV.jl package but am getting this error

julia> CSV.write("/tmp/out.csv",testmap)
ERROR: TypeError: streamto!: in typeassert, expected String, got DataArrays.NAtype

I thought the new DataFrames and CSV package would resolve this type of issue. How do I get around this?

CSV version 0.1.5
DataFrame version 0.11
Julia version is 0.6.2


I think providing testmap here would be good to help you, or we cannot reproduce the problem.


This might be a package version mismatch. I think DataFrames v0.11 needs DataArrays v0.7, and that I believe doesn’t have the NAtype anymore, so you probably are stuck on an old DataArrays version. I also think that CSV.jl v0.2.0 is the version that works with DataFrames v0.11.

I thought there were enough bounds in place in METADATA to make sure you only get things that match, but maybe not?


I think I see the issue. I have a julia package OdsIO installed. It forced a downgrade of the CSV and DataArrays package.