Pandas get topmost n records within each group August 21, 2022 by Magenaut Suppose I have pandas DataFrame like this: