Hello,
I used to save a dataframe to a tsv file with
using CSV, DataFrames
CSV.write("./myFile.tsv", df;
header=false, delim='\t', append=false, decimal: '.', quotechar: '"')
where df
is the object containing the data frame.
However, I now get the error:
julia> CSV.write("./myFile.tsv", df;
header=false, delim='\t', append=false, decimal: '.', quotechar: '"')
ERROR: syntax: invalid keyword argument syntax "decimal:Char(0x2e000000)"
Stacktrace:
[1] top-level scope
@ none:1
If I shorten the syntax, it is even worse:
julia> CSV.write("./myFile.tsv", df;
header=false, delim='\t', append=false)
ERROR: UndefVarError: writeshortest not defined
Stacktrace:
[1] writecell(buf::Vector{UInt8}, pos::Int64, len::Int64, io::IOStream, x::Float64, opts::CSV.Options{UInt8, UInt8, Nothing, Tuple{}, typeof(CSV._identity)})
@ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:444
[2] (::CSV.var"#106#107"{Vector{UInt8}, Base.RefValue{Int64}, Int64, IOStream, Int64, CSV.Options{UInt8, UInt8, Nothing, Tuple{}, typeof(CSV._identity)}, UInt8, UInt8})(val::Float64, col::Int64, nm::Symbol)
@ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:371
[3] eachcolumn
@ ~/.julia/packages/Tables/T7rHm/src/utils.jl:70 [inlined]
[4] writerow(buf::Vector{UInt8}, pos::Base.RefValue{Int64}, len::Int64, io::IOStream, sch::Tables.Schema{(:timestamp, :value1, :value2, :value3), NTuple{4, Float64}}, row::DataFrameRow{DataFrame, DataFrames.Index}, cols::Int64, opts::CSV.Options{UInt8, UInt8, Nothing, Tuple{}, typeof(CSV._identity)})
@ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:367
[5] (::CSV.var"#99#100"{Bool, Bool, Tables.Schema{(:timestamp, :value1, :value2, :value3), NTuple{4, Float64}}, DataFrames.DataFrameRows{DataFrame}, CSV.Options{UInt8, UInt8, Nothing, Tuple{}, typeof(CSV._identity)}, Vector{UInt8}, Int64, Int64, NTuple{4, Symbol}})(io::IOStream)
@ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:235
[6] with(f::CSV.var"#99#100"{Bool, Bool, Tables.Schema{(:timestamp, :value1, :value2, :value3), NTuple{4, Float64}}, DataFrames.DataFrameRows{DataFrame}, CSV.Options{UInt8, UInt8, Nothing, Tuple{}, typeof(CSV._identity)}, Vector{UInt8}, Int64, Int64, NTuple{4, Symbol}}, io::Any, append::Bool, compress::Bool)
@ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:303
[7] #write#98
@ ~/.julia/packages/CSV/jFiCn/src/write.jl:225 [inlined]
[8] write(file::String, itr::DataFrame; delim::Char, quotechar::Char, openquotechar::Nothing, closequotechar::Nothing, escapechar::Char, newline::Char, decimal::Char, dateformat::Nothing, quotestrings::Bool, missingstring::String, transform::typeof(CSV._identity), bom::Bool, append::Bool, compress::Bool, writeheader::Nothing, partition::Bool, kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:header,), Tuple{Bool}}})
@ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:210
[9] top-level scope
@ none:1
What is the current syntax to save a data frame to file?
Thank you