function returning pandas dataframe
问题 I was not clear about my issue, so I am reviewing the question. I have a function manipulating a generic dataframe (it removes and renames columns and records): def manipulate_df(df_local): df_local.rename(columns={'A': 'grouping_column'}, inplace = True) df_local.drop('B', axis=1, inplace=True) df_local.drop(df.query('grouping_column not in (\'1\', \'0\')').index, inplace = True) df_local = df_local.groupby(['grouping_column'])['C'].sum().to_frame().reset_index().copy() print("this is what I