You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code makes things work for me. Basically getting rid of vector types CSV is using now and casting it to a Vector (I understand it goes against the idea of latest release, just a workaround for now),
csv_file = CSV.File(IOBuffer("x,y\n,3\n,4"))
newcols = AbstractVector[]
for col in getfield(csv_file, :columns)
push!(newcols, Vector{eltype(col)}(col))
end
x = DataFrame!(newcols, getfield(csv_file, :names))
dropmissing!(x, :y)
quinnj
added a commit
to JuliaData/SentinelArrays.jl
that referenced
this issue
Jul 17, 2020
FixesJuliaData/CSV.jl#690. The issue here is we weren't
testing or accounting for the case when the `inds` arguement to deleteat! is empty.
This comes up in practice from `dropmissing!` in DataFrames.jl when there are no missing
values in a column, it still calls `deleteat!` with the empty array.
The fix is pretty straightforward: we can just remove the bounds checks here because
we're doing the bounds check in the underlying `::Integer` method anyway.
gives error
ERROR: BoundsError: attempt to access 0-element Array{Int64,1} at index [1]
. Note, not in placedropmissing
works fine.I am running
also reading CSV the old style
CSV.read(IOBuffer("x,y\n,3\n,4"), copycols = true)
causes same errorIs it me missing some option or CSV (or DataFrames) issue?
The text was updated successfully, but these errors were encountered: