added shallow_copy function and use it in grouped_df_impl