Closed ym-han closed 4 years ago
using DataFrames; b = DataFrame(a = rand([missing, nothing), 100))
JDF.save("c:/scratch/plsdel.jdf", b)
You might have Nothing
and Missing
in one column?
This is not supported. Can you describe your use case? I can add support if needed.
Do you think you can print the column types of all your columns? Like
println.(typeof.(eachcol(df)))
If the issue is that the column contains nothing
and missing
then it does not support and I don't see a good reason to support it.
If you have a good use-case for it, then please reopen and describe the use-case. Otherwise, I will close for now.
These are the dfs I tried out. I added the file tree code just in case I had done something wrong there:
`df1 = FileTrees.get(files(test)[1])
1×11 DataFrame. Omitted printing of 11 columns
│ Row │ │ │ ├────┼
│ 1 │
julia> df3 = FileTrees.get(files(test)[3])
14×11 DataFrame. Omitted printing of 11 columns
│ Row │ │ │ ├────┼
│ 1 │ │ 2 │ │ 3 │ │ 4 │ │ 5 │ │ 6 │ │ 7 │ │ 8 │ │ 9 │ │ 10 │ │ 11 │ │ 12 │ │ 13 │ │ 14 │
julia> df2 = FileTrees.get(files(test)[2])
8×11 DataFrame. Omitted printing of 11 columns
│ Row │ │ │ ├─────┼
│ 1 │ │ 2 │ │ 3 │ │ 4 │ │ 5 │ │ 6 │ │ 7 │ │ 8 │
julia> println.(typeof.(eachcol(df1)))
Array{String,1}
Array{String,1}
Array{String,1}
Array{String,1}
Array{String,1}
Array{Int64,1}
Array{Int64,1}
Array{Float64,1}
Array{String,1}
Array{String,1}
Array{String,1}
11-element Array{Nothing,1}:
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing
julia> println.(typeof.(eachcol(df2)))
Array{String,1}
Array{String,1}
Array{String,1}
Array{String,1}
Array{String,1}
Array{Int64,1}
Array{Int64,1}
Array{Float64,1}
Array{Any,1}
Array{String,1}
Array{String,1}
11-element Array{Nothing,1}:
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing
julia> println.(typeof.(eachcol(df3)))
Array{String,1}
Array{String,1}
Array{String,1}
Array{String,1}
Array{String,1}
Array{Int64,1}
Array{Int64,1}
Array{Float64,1}
Array{Array{Set{Tuple{String,String}},1},1}
Array{String,1}
Array{String,1}
11-element Array{Nothing,1}:
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing`
OK after some testing, I'm pretty sure it's the col with the type Array{Array{Set{Tuple{String,String}},1},1} that's causing the issue.
Array{Array{Set{Tuple{String,String}},1},1}
It's not really possible for JDF to support all types and be a cross-language format. So that format won't be supported.
For now you need to convert them to a type supported by JDF. You can find a list of supported type in the front page of this repo.
I would need to work on better error messages(#49) and better instructions for dealing with these (#50).
I got the following error while trying to save some files; I'll upload a MWE later.