Skip to content

Instantly share code, notes, and snippets.

@anbento0490
Created May 2, 2020 13:17
Show Gist options
  • Save anbento0490/fa322f3c08d04ac8a13e68aa0d8c612e to your computer and use it in GitHub Desktop.
Save anbento0490/fa322f3c08d04ac8a13e68aa0d8c612e to your computer and use it in GitHub Desktop.
#3. DENSE_RANK() --> RANK(method='dense')
orders['Dense Rank'] = orders.groupby(['Customer ID'])['Order Date'].rank(method='dense')
orders.head(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment