ArgumentError: by function was removed from DataFrames.jl. Use the `combine(groupby(...), ...)` or `combine(f, groupby(...))` instead.
What adaptation would you use to convert the block above into one that includes combine(f, groupby(…)) since the by() method has been discontinued by Julia.
I applied:
grGr = groupby(dropmissing(data), [:Grade])
Then:
aggPr = combine(grGr, [:Price] .=> mean)
How would you combine these blocks? Or is it good practice to keep them separate?
I’m not exactly sure what you wanted to do originally, but what that line was doing doing is defining the sequence from 1 to 500 with stepsize .001 (checkout collect(1:.001:500)) and then drawing one random sample from that.
While by was deprecated from DataFrames.jl, it lives on in the macro @by in DataFramesMeta.jl.
DataFramesMeta.jl provides a more convenient syntax for helping new users use Split-Apply-Combine concepts, as well as more basic transformations, in DataFrames. I recommend you check it out.