I often need to create binned statistics like this at the end of a chain of table transformations, so I’d prefer to be able to do everything in one line without the temp tables. Is there any way to acheive something like the following syntax? Is it reasonable to to make a feature request to support it?
julia> by(d, cut(:x, 4), :x => mean)
This syntax would be similar to what is possible in kdb+/q:
this isn’t possible at the moment in DataFrames. You can file an issue that would make this easier, but note that your function always has to be evaluated, so unless cut only returns an iterator and not a vector, I would just write a small wrapper function to do this for you.
It’s more than reasonable to request this as a feature.
Hmmm… I was doing this maybe 6-7 months ago through some sort of weird work around not using cut… Maybe I made my own iterator? I remember it not being too hard, but groking the latest code looks like things are different from what I remember… Maybe take a crack at making one?