-
Notifications
You must be signed in to change notification settings - Fork 55
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
Request - grouped by columns available as single values rather than vectors #361
Comments
@Lincoln-Hannah - indeed I also often need it. I understand that this is request for DataFramesMeta.jl. The only issue is mixing grouping and non-grouping columns. Maybe something like
What you currently can do is use |
@Lincoln-Hannah Can I have more information on your use-case? I also do this all the time, but |
See related request: mauro3/Parameters.jl#153 I'd like to move between DataFrames and arrays of structs as effortlessly as possible. If I create a
A struct derived from a grouped DataFrame, will have single value fields for the group by columns and vector fields for the non-group-by columns. |
Okay so you would like
to not return a I still need more information on what you want. What is the output you desire? Give it as a Julia object, not a description. |
Sorry Peter. My bad. I was trying to isolate the key line. To get to a vector there would be an additional line.
Actually, more often I'd put the result in a Dictionary. Example.
[ (a=1,b=11,c=[1,2],d=[11,12]), each row becomes a myStruct. The last line creates a dictionary.
We can then apply a function to any element
or broadcast over all
|
Would it be possible, within a @by block, to make the grouped by columns available as single values rather then vectors?
In the below, I'd like to create a column of
myCurve
structs, but because the:name
column comes through as a vector, it only works for themyCurve_name_vec
structs. I could convert it, it just wouldn't be so clean.More generally, if you are grouping by a column, any related calculations would likely use that column as a single value.
The text was updated successfully, but these errors were encountered: