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

Error for unstacking an empty dataframe #2841

Closed
kollch opened this issue Aug 22, 2021 · 1 comment · Fixed by #2842
Closed

Error for unstacking an empty dataframe #2841

kollch opened this issue Aug 22, 2021 · 1 comment · Fixed by #2842
Labels
Milestone

Comments

@kollch
Copy link

kollch commented Aug 22, 2021

When attempting to run the unstack function on an empty dataframe, the error produced references an internal MethodError:

ERROR: no method matching DataFrame(::Vector{Vector{Any}}, ::Vector{Any}; copycols=false)

How to replicate:

df = DataFrame(a = [], b = [], c = [])
unstack(df, :b, :c)

I think it'd be nice to have a check for this, especially considering stack doesn't appear to have a similar problem.

@bkamins
Copy link
Member

bkamins commented Aug 23, 2021

Thank you for reporting. This is a problem with broadcasting in base. Fixed in #2842

@bkamins bkamins added the bug label Aug 23, 2021
@bkamins bkamins added this to the patch milestone Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants