So I think what you’re asking for is basically groupby(df, :column => function) which doesn’t exist and probably won’t exist in DataFrames, but maybe in a convenience package, see my issue here: `groupby` derived columns · Issue #392 · JuliaData/DataFramesMeta.jl · GitHub
DataFramesMacros has a similar functionality here:
https://jkrumbiegel.com/DataFrameMacros.jl/stable/#@groupby
see the @groupby(df, :evenheight = iseven(:height)) which creates an :evenheight column on the fly.
In base Julia/DataFrames you can do something like:
julia> using DataFrames, Dates
julia> df = DataFrame(event_time = rand(Date(2024):Day(1):Date(2025), 100), value = rand(100));
julia> (df[(op).(dayofweek.(df.event_time), 4), :] for op ∈ (<, >)) .|> (x -> combine(groupby(x, :event_time), nrow, :value => sum))
2-element Vector{DataFrame}:
(...)
which I think is what you want?