ENH: infer selection_obj on groupby with an applied method (GH5610)