To facilitate groupby-type operations, from mailing list:
With the following:
df # predefined
df['E'] = pandas.Series(0.)
for grp_name, grp_data in df.groupby(['C','D']):
# snipped code here; returns a scalar x that is dependent on
grp_data
grp_data['E'] = x # NB df['E'] not updated
I was wondering if there was a way of internally capturing child-
parent relationships between dataframes so that each 'grp_data'
dataframe knows that its parent is dataframe 'df' and knows how to
propagate assignments back to the parent dataframe using column names
and row masks. I suppose this would require that grp_data is an
instance of a subclass of pandas.DataFrame.```
Not sure how feasible this is, but an idea.
Comment From: wesm
Closing in favor of more generalized work on deferred evaluation in pandas 2.0