Commit Graph

204 Commits

Author SHA1 Message Date
Raymond Hettinger aef375f56e
Minor algebraic simplification for the totient() recipe (gh-113822) 2024-01-08 13:16:22 -06:00
Raymond Hettinger b5dc0f83ad
Misc minor improvements to the itertools recipes (gh-113477) 2023-12-25 16:26:04 -06:00
Raymond Hettinger 1583c40be9
gh-113202: Add a strict option to itertools.batched() (gh-113203) 2023-12-16 09:13:50 -06:00
Raymond Hettinger 40574da019
Add reshape() recipe to demonstrate a use case for batched() and chained.from_iterable() (gh-113198) 2023-12-15 18:03:44 -06:00
Raymond Hettinger 5f7d7353b4
Optimize unique_justseen() recipe for a common case. (gh-113147) 2023-12-14 17:27:39 -06:00
Raymond Hettinger becad9a2a1
Remove itertool recipe with low pedagogical value (gh-113138) 2023-12-14 14:36:40 -06:00
Raymond Hettinger 93cf7358d9
Add recipe for totient() to demonstrate unique_justseen() and factor(). (gh-113131) 2023-12-14 13:15:29 -06:00
Raymond Hettinger 2111795d0c
Use match/case in grouper() recipe (gh-113059)
Use match/case in grouper() reciper
2023-12-13 12:11:52 -06:00
Jurjen N. E. Bos c2e2df8356
Minor stylistic edit to the grouper recipe (gh112759) 2023-12-05 12:44:06 -06:00
Sebastian Rittau 6c47eaccfa
Fix docstring and var name of itertools recipe (#112113)
`prepend()` works with arbitrary iterables, not only iterators. In fact,
the example given uses a `list`, which is iterable, but not an iterator.
2023-11-22 07:35:36 +02:00
Nikita Sobolev ee2d22f06d
gh-111343: Fix `itertools` docs: `start` arg is optional for `count` (gh-111344) 2023-10-27 04:30:13 +00:00
Łukasz Langa 46b63ced25
Remove outdated docstring from the `quantify` itertools recipe (#109726) 2023-09-22 15:09:32 +02:00
Raymond Hettinger f2636d2c45
Misc itertool recipe improvements, mostly docstrings and comments (gh-109555) 2023-09-19 07:39:44 -05:00
Raymond Hettinger f2a55fecd0
Fix iter_index() to work with lists which do not support stop=None. (gh-109306) 2023-09-12 04:04:28 +02:00
Raymond Hettinger d3ed9921cd
Improve the sieve() recipe in the itertools docs (gh-109199)
Lazier sieve
2023-09-09 17:50:04 -05:00
Raymond Hettinger f373c6b948
gh-107208: Fix iter_index() recipe to not swallow exceptions (gh-108835)
gh-107208: iter_index now supports "stop" and no longer swallows ValueError
2023-09-02 22:25:13 -05:00
Raymond Hettinger 6db39b1460
Minor code clean-up for the factor() recipe (GH-108114) 2023-08-18 12:13:58 -05:00
Raymond Hettinger babb22da5a
Add more recipe tests. Make the factor recipe a bit faster and clearer. (GH-106817) 2023-07-16 21:37:07 -05:00
Raymond Hettinger e2ec0bad67
Add more examples to the recipe docs (GH-106782)
Demonstrate that factor() works for large composites and large primes.
2023-07-15 14:43:09 -05:00
Raymond Hettinger 7709037095
Small speed-up for the convolve() recipe. (GH-106371) 2023-07-03 15:38:38 -05:00
Raymond Hettinger 423459be2f
sliding_window() recipe: Raise ValueError for non-positive window sizes. Add more tests. (GH-105403) 2023-06-06 13:44:45 -05:00
Raymond Hettinger 278030a17d
Misc improvements to the itertools docs (GH-104916) 2023-05-24 22:31:02 -05:00
Raymond Hettinger c3453fbb11
Update itertool recipe: polynomial_from_roots() (GH-103973) 2023-04-28 12:25:50 -05:00
Raymond Hettinger f65fdbb8fd
Itertool recipe improvements (GH-103399) 2023-04-09 14:17:37 -05:00
Raymond Hettinger 16f6165b71
Minor readability improvement to the factor() recipe (GH-102971) 2023-03-23 14:46:15 -05:00
Raymond Hettinger 0214c7ad90
Tweak polynomial itertool recipes (GH-102880) 2023-03-21 13:21:57 -05:00
wim glenn 4bb1dd3c5c
gh-102876: remove superfluous parens from itertools.batched recipe (GH-102877)
remove superfluous parens from itertools.batched recipe
2023-03-21 12:06:18 -05:00
Raymond Hettinger 1a5a14183e
The pow() variant further improves accuracy (GH-102866) 2023-03-21 00:02:14 -05:00
Raymond Hettinger 4075fe1d8d
Remove itermediate list. Expand docstring. (GH-102862) 2023-03-20 20:40:04 -05:00
Raymond Hettinger 094cf392f4
Add itertool recipe for polynomial evaluation. (GH-102852) 2023-03-20 17:14:29 -05:00
Stefan Pochmann eaae563b68
gh-102088 Optimize iter_index itertools recipe (GH-102360) 2023-03-01 21:16:23 -06:00
Stefan Pochmann 81bf10e4f2
gh-102105 Fix wording in filterfalse/quantify/filter (GH-102189) 2023-02-24 10:13:05 -06:00
Raymond Hettinger 6bde3d2fd3
Add recipes to showcase tee(), zip*, batched, starmap, and product. (GH-101023) 2023-01-13 19:01:22 -06:00
Raymond Hettinger 47b9f83a83
GH-100485: Add math.sumprod() (GH-100677) 2023-01-07 12:46:35 -06:00
Raymond Hettinger 4ebaae8aed
Improve comments in itertools uniquification recipes (GH-100631) 2022-12-30 20:36:38 -06:00
Raymond Hettinger c4c5790120
Restore early-out to factor(). Strengthen tests. (GH-100591) 2022-12-28 12:29:27 -08:00
Raymond Hettinger 2d52406835
Improve factor() recipe and fix its tests (GH-100576) 2022-12-28 03:13:58 -08:00
Raymond Hettinger 0769f95751
Misc Itertools recipe tweaks (GH-100493) 2022-12-24 00:21:30 -08:00
Raymond Hettinger f89de679ff
Add "strict" to dotproduct(). Add docstring. Factor-out common code. (GH-100480) 2022-12-23 15:52:16 -08:00
Raymond Hettinger 8356c14b4f
Remove uninformative itertools recipe (GH-100253) 2022-12-15 12:39:01 -06:00
Raymond Hettinger 35cc0ea736
GH-98363: Have batched() return tuples (GH-100118) 2022-12-08 15:08:16 -06:00
Julien Palard c1c3be0f9d
Doc: Fix sphinx-lint issues (GH-98911)
They were introduced right between GH-98441 and GH-98408.
2022-10-31 16:30:29 +01:00
Raymond Hettinger a53f637368
Fix markup indentation (GH-98424)
Fix markup
2022-10-18 20:14:41 -05:00
Raymond Hettinger f4ead4874b
General improvements to the itertools docs (GH-98408) 2022-10-18 14:09:34 -05:00
Raymond Hettinger de3ece769a
GH-98363: Add itertools.batched() (GH-98364) 2022-10-17 18:53:45 -05:00
Raymond Hettinger 70732d8a4c
Move random selection recipes from itertools.rst to random.rst (GH-98369) 2022-10-17 17:30:49 -05:00
Raymond Hettinger 3a639bbeac
Improve speed. Reduce auxiliary memory to 16.6% of the main array. (GH-98294) 2022-10-15 16:05:28 -05:00
Raymond Hettinger f4370318d6
Faster sieve() recipe (#98287) 2022-10-15 12:43:58 -05:00
Raymond Hettinger e500cc0451
Misc updates to the itertools recipes and tests (GH-98018) 2022-10-07 03:37:21 -05:00
Raymond Hettinger 78359b1d45
Simplify sieve() recipe. Add edge case tests. (GH-96892) 2022-09-17 11:31:04 -05:00