I’m still trying to figure out a MWE. I’m encountering a weird issue as follows where df
is a DataFrame
and d
is Vector{Int64}
. Any idea?
julia> deleterows!(df, d)
ERROR: MethodError: no method matching deleteat!(::Base.ReshapedArray{Union{Missing, Float64},1,Array{Union{Missing, Float64},2},Tuple{}}, ::Array{Int64,1})
Closest candidates are:
deleteat!(::Array{T,1} where T, ::AbstractArray{T,1} where T) at array.jl:1213
deleteat!(::Array{T,1} where T, ::Any) at array.jl:1212
deleteat!(::BitArray{1}, ::Any) at bitarray.jl:940
...
Stacktrace:
[1] (::getfield(DataFrames, Symbol("##72#73")){Array{Int64,1}})(::Base.ReshapedArray{Union{Missing, Float64},1,Array{Union{Missing, Float64},2},Tuple{}}) at /home/tkwong/.julia/packages/DataFrames/IKMvt/src/dataframe/dataframe.jl:871
[2] foreach(::getfield(DataFrames, Symbol("##72#73")){Array{Int64,1}}, ::Array{AbstractArray{T,1} where T,1}) at ./abstractarray.jl:1866
[3] deleterows!(::DataFrame, ::Array{Int64,1}) at /home/tkwong/.julia/packages/DataFrames/IKMvt/src/dataframe/dataframe.jl:871
[4] top-level scope at none:0
There’s nothing fancy about the DataFrame:
julia> describe(df)
17×8 DataFrame
│ Row │ variable │ mean │ min │ median │ max │ nunique │ nmissing │ eltype │
│ │ String │ Union… │ Any │ Union… │ Any │ Union… │ Union… │ DataType │
├─────┼──────────┼─────────────┼──────────────┼──────────────┼────────────┼─────────┼──────────┼──────────┤
│ 1 │ var1 │ 12.9394 │ 0.112803 │ 4.57057 │ 43.3651 │ │ │ Float64 │
│ 2 │ var2 │ 6.62466 │ -2.28851 │ 1.00144 │ 35.3775 │ │ 0 │ Float64 │
│ 3 │ var3 │ │ abc │ │ xyz │ 14 │ 0 │ String │
│ 4 │ var4 │ 0.0862132 │ -0.0201804 │ 0.00865615 │ 0.502727 │ │ 0 │ Float64 │
│ 5 │ var5 │ 2.52696 │ -5.56837 │ 0.280422 │ 20.2763 │ │ 0 │ Float64 │
│ 6 │ var6 │ 2.38489 │ -3.1457 │ 0.254247 │ 16.6263 │ │ 0 │ Float64 │
│ 7 │ var7 │ -0.0034382 │ -0.0190981 │ -0.000636895 │ 0.00132188 │ │ 0 │ Float64 │
│ 8 │ var8 │ 0.0945996 │ -0.0 │ 0.0 │ 1.32439 │ │ 0 │ Float64 │
│ 9 │ var9 │ 0.0568503 │ -0.127484 │ 0.00637622 │ 0.370084 │ │ 0 │ Float64 │
│ 10 │ var10 │ 0.42912 │ -1.01617 │ 0.0407236 │ 2.7647 │ │ 0 │ Float64 │
│ 11 │ var11 │ -9.80372e-5 │ -0.00307758 │ -7.38922e-6 │ 0.00319956 │ │ 0 │ Float64 │
│ 12 │ var12 │ 0.00869214 │ -0.000195758 │ 0.00181751 │ 0.0535332 │ │ 0 │ Float64 │
│ 13 │ var13 │ 0.0357346 │ -0.00427665 │ 0.00455445 │ 0.190761 │ │ 0 │ Float64 │
│ 14 │ var14 │ 0.192752 │ -0.295851 │ 0.0143688 │ 0.794363 │ │ 0 │ Float64 │
│ 15 │ var15 │ 0.0 │ -0.0 │ 0.0 │ 0.0 │ │ 0 │ Float64 │
│ 16 │ var16 │ -0.163465 │ -8.84644 │ -0.0122285 │ 16.7318 │ │ 0 │ Float64 │
│ 17 │ var17 │ 0.975848 │ -8.84644 │ 0.0591109 │ 14.6835 │ │ 0 │ Float64 │
and d = [12]