Pandas: top N rows, top N rows per group, equivalent for ROW_NUMBER OVER(PARTITION BY ... ORDER BY ...)
<p>What is the python equivalent to the TOP function in T-SQL? I'm looking to filter my dataframe to the top 50K rows.  I've looked online and I can't find a simple example.</p>