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

Cannot vcat DataFrames with ReadStatTables.LabeledArrays #3351

Closed
greimel opened this issue Jun 26, 2023 · 2 comments
Closed

Cannot vcat DataFrames with ReadStatTables.LabeledArrays #3351

greimel opened this issue Jun 26, 2023 · 2 comments
Labels
bug ecosystem Issues in DataFrames.jl ecosystem
Milestone

Comments

@greimel
Copy link

greimel commented Jun 26, 2023

using ReadStatTables, DataFrames
lbls1 = Dict(1=>"a", 2=>"b");
x = LabeledArray([0, 1, 2], lbls1)

df = DataFrame(; x)

[x; x]
[df; df] # ERROR: MethodError: Cannot `convert` an object of type Int64 to an object of type LabeledValue{Int64, Int64}

I am not sure if that is due to a bug in DataFrames or ReadStatTables, though.

@greimel greimel changed the title Cannot vcat two DataFrames with ReadStatTables.LabeledArrays Cannot vcat DataFrames with ReadStatTables.LabeledArrays Jun 26, 2023
@bkamins
Copy link
Member

bkamins commented Jun 26, 2023

It is a problem with ReadStatTables.jl, because it should define DataAPI.defaultarray method and it does not. The reason is that the eltype LabelledValue needs to be stored in LabelledVector and package should signal this.

@bkamins bkamins added bug ecosystem Issues in DataFrames.jl ecosystem labels Jun 26, 2023
@bkamins bkamins added this to the 1.6 milestone Jun 26, 2023
@greimel
Copy link
Author

greimel commented Jun 28, 2023

Fixed by @junyuan-chen in junyuan-chen/ReadStatTables.jl#28 - thank you so much!

@greimel greimel closed this as completed Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ecosystem Issues in DataFrames.jl ecosystem
Projects
None yet
Development

No branches or pull requests

2 participants