You may or may not be surprised to learn that for a DataFrame .=
isn’t always in-place. It surprised me for sure, but I didn’t follow the announcements so that’s on me.
What if it was always in-place for existing columns though? And what if normal assignment only created an alias if explicitly declared (with copy on assignment otherwise, with fill for scalars)? Would that be at all breaking?
I’m curious to learn if you have used or seen:
-
df.col .= v
on an existing column where you need it to not be in-place -
df.col = v
where you needv === df.col
-
Either of the above with
df[!, :col]
Here’s a tentative implementation to run with your unit tests if you’d like to: In-place broadcast assignment by gustafsson · Pull Request #3206 · JuliaData/DataFrames.jl · GitHub