Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dataframe issue with converting to Matrix{Bool} #93

Closed
khosravipasha opened this issue Aug 24, 2021 · 1 comment
Closed

Dataframe issue with converting to Matrix{Bool} #93

khosravipasha opened this issue Aug 24, 2021 · 1 comment

Comments

@khosravipasha
Copy link
Collaborator

It seems in the new version of DataFrames some of the code we have fails intwenty_datasets function.

https://github.com/Juice-jl/LogicCircuits.jl/blob/e92c417386f4b3a9089c1302148d30cbe82c6951/src/LoadSave/data_loaders.jl#L63

The error is

ERROR: MethodError: Cannot `convert` an object of type DataFrames.DataFrame to an object of type Matrix{Bool}
Closest candidates are:
  convert(::Type{Array{T, N}}, ::StaticArrays.SizedArray{S, T, N, N, Array{T, N}}) where {S, T, N} at /home/pasha/.julia/packages/StaticArrays/vxjOO/src/SizedArray.jl:120
  convert(::Type{Array{T, N}}, ::StaticArrays.SizedArray{S, T, N, M, TData} where {M, TData<:AbstractArray{T, M}}) where {T, S, N} at /home/pasha/.julia/packages/StaticArrays/vxjOO/src/SizedArray.jl:114
  convert(::Type{Array{S, N}}, ::PooledArrays.PooledArray{T, R, N, RA} where RA) where {S, T, R, N} at /home/pasha/.julia/packages/PooledArrays/CV8kA/src/PooledArrays.jl:425
  ...
Stacktrace:
 [1] (::LogicCircuits.LoadSave.var"#load#89"{String, String})(type::String)
   @ LogicCircuits.LoadSave ~/.julia/dev/LogicCircuits/src/LoadSave/data_loaders.jl:63
 [2] twenty_datasets(name::String)
   @ LogicCircuits.LoadSave ~/.julia/dev/LogicCircuits/src/LoadSave/data_loaders.jl:65
 [3] top-level scope
   @ REPL[5]:1

Also might want to add a test for twenty_datasets

@khosravipasha
Copy link
Collaborator Author

can use Tables.matrix(dataframe) to do this conversion. Already fixed in the code #94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant