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
and this fails (same cause but different place): sample(eachrow(view(df)), 10; replace=false)
The errors imply that the x allocated in sample() (line 459 in my version of StatsBase) is allocating a data type that has no implicit conversion:
ERROR: MethodError: Cannot `convert` an object of type DataFrameRow{DataFrame,DataFrames.Index} to an object of type DataFrameRow{SubDataFrame{DataFrame,DataFrames.Index,Array{Int64,1}},DataFrames.Index}
Closest candidates are:
...
Stacktrace:
[1] setindex!(::Array{DataFrameRow{SubDataFrame{DataFrame,DataFrames.Index,Array{Int64,1}},DataFrames.Index},1}, ::DataFrameRow{DataFrame,DataFrames.Index}, ::Int64) at ./array.jl:782
[2] fisher_yates_sample!(::Random._GLOBAL_RNG, ::DataFrames.DataFrameRows{SubDataFrame{DataFrame,DataFrames.Index,Array{Int64,1}},DataFrames.Index}, ::Array{DataFrameRow{SubDataFrame{DataFrame,DataFrames.Index,Array{Int64,1}},DataFrames.Index},1}) at /root/.julia/packages/StatsBase/unDUx/src/sampling.jl:160
This doesn't affect me because I can just sample 1:nrow(df) and index to get the same row, but just thought I should put it out there.
The text was updated successfully, but these errors were encountered:
This works as expected:
sample(eachrow(view(df)))
But this fails:
sample(eachrow(view(df)), 10)
and this fails (same cause but different place):
sample(eachrow(view(df)), 10; replace=false)
The errors imply that the x allocated in
sample()
(line 459 in my version of StatsBase) is allocating a data type that has no implicit conversion:This doesn't affect me because I can just sample
1:nrow(df)
and index to get the same row, but just thought I should put it out there.The text was updated successfully, but these errors were encountered: