CSV.write() won't take nothing values

You can use something function to convert nothing to whatever you want (e.g. missing) like this:

something.(df, missing) |> CSV.write("aaa.txt")

The current reasoning behind the design not to support nothing when writing a CSV file is given here.


I prefer the syntax of the CSV transform argument:

CSV.write("filename.csv", df, transform=(col, val) -> something(val, missing))

From the CSV.write documentation

Posting this as a separate answer, hopefully to distinguish comments and gather clarifications if I am missing something important.

Tags:

Julia