-
Notifications
You must be signed in to change notification settings - Fork 370
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
Clean up colwise #485
Comments
For most uses the length of the result will be the same for all columns, so indeed it would be nice to get a more specific type. I think it would be natural to return the same type as what a list comprehension syntax would return. Now, currently there's issue JuliaLang/julia#5258, but in the long term this would not return an |
Revisiting this 2 years later, colwise still returns an array of Any, where each element is a Vector, even when the result of each operation is a scalar. Example: df =DataFrame(a = repeat([1,2,3,4], outer =[2]), b =repeat([2,3], outer =[4]), c =randn(8))
cs = colwise(sum, df) gives
I feel this is not convenient for further work on the column results, e.g. I may want to make a histogram of the column sums. I then have to using Plots; histogram(vcat(cs...)) |
@mkborregaard this has been addressed in DataTables by JuliaData/DataTables.jl#28 |
Great, thanks for the heads up! Must be nice to be able to close a three year old issue :-) |
Instead of offering functions
colmean
,colstd
, etc., I'd like to lean more heavily oncolwise
. Right now its behavior surprises, although I think I understand the logic.I assume we do this with the assumption that the return values for a function may differ in length across columns, which means that we can't do better than return a generic
Array{Any}
. That might be the right approach, but it's worth making sure that we prefer this very general strategy over something that would produce a more easily interpreted DataFrame.The text was updated successfully, but these errors were encountered: