Created
January 4, 2023 17:18
-
-
Save axil/7519b0b863827a291a704a8e765e2a3e to your computer and use it in GitHub Desktop.
groupby-sort
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> s = pd.Series([1, 3, 20, 2, 10]) | |
>>> for k, v in s.groupby(s//10, sort=False): | |
print(k, v.tolist()) | |
0 [1, 3, 2] | |
2 [20] | |
1 [10] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment