Broadcasting: Difference between = and .= for DataFrames

df[indices] .= y effectively calls broadcast!(identity, df[indices], y): that is, the broadcast operation (.=) acts on df[indices], which is a copy of the dataframes data rather than the original data.

Technically, the way to fix this is to define a Base.dotview function for DataFrame.

3 Likes