Created
July 14, 2019 15:46
-
-
Save eyaltrabelsi/2c37b20f07d262f7f5c8f95ebcbae665 to your computer and use it in GitHub Desktop.
Creating accumulated results of iterable given a function
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
>>> import itertools | |
>>> list(itertools.accumulate([9, 21, 17, 5, 11, 12, 2, 6], min)) | |
[9, 9, 9, 5, 5, 5, 2, 2] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment