Closed jeremiahpslewis closed 1 year ago
I think there was something in the works at DataFrames.jl which allowed data updates with transform!
on a subset view, but I haven't had time yet to take a look at the implementation, or if something can be improved on DataFrameMacro's side to help. The @update
macro is a good idea, but maybe it can be done with only DataFrames tools, just improved syntax.
Here's the link to transform!
for future reference: https://dataframes.juliadata.org/stable/lib/functions/#DataFrames.transform!, added in v1.3. Looks like it roughly covers the idea, with an elegant implementation for filtered out rows: missing values. Key decision may be whether to allow @m
missing flag to toggle whether rows are filled in with missing or with original values.
This actually has been implemented for a while now with @transform!(df, @subset(...
and I just didn't notice I should close this issue.
Haven't found a good way of using DataFramesMacros to express data updates, but think it may be an unmet need:
Where @update modifies the columns only for the rows passed to it.
I imagine there are lots of reasons this quickly becomes an anti-pattern (@groupby, etc), so feel free to reject and close immediately, but this is the only remaining use case where I can't figure out how to stay within the DataFrameMacros paradigm and its world of relative dataframe-manipulation ease and parsimony. 😀