Message352696
FWIW, pairwise() is in the more-itertools module. A quick code search does show occasional use in the wild: https://github.com/search?q=language%3Apython+more_itertools.pairwise&type=Code
In my own code, I've had some cases that almost fit but they needed custom padding on one end or both ends: zip([0.0] + data, data + [1.0]). Also, its unclear where anyone would want a wider sliding window.
Tim, do you have any thoughts about pairwise()? |
|
Date |
User |
Action |
Args |
2019-09-18 05:54:06 | rhettinger | set | recipients:
+ rhettinger, tim.peters, della |
2019-09-18 05:54:06 | rhettinger | set | messageid: <1568786046.2.0.881789338918.issue38200@roundup.psfhosted.org> |
2019-09-18 05:54:06 | rhettinger | link | issue38200 messages |
2019-09-18 05:54:06 | rhettinger | create | |
|