RafaelWO
3eecc72ac7
Docs: Improve example for `itertools.batched()
` ( #136775 )
...
The current example `batched('ABCDEFG', n=3) → ABC DEF G` can confuse readers because both, the size of the tuples and the number of tuples are 3.
By using a batch size of n=2, it is clearer that the `n` argument refers to the size of the resulting tuples.
I.e. the new example is: `batched('ABCDEFG', n=2) → AB CD EF G`
2025-07-19 10:29:44 +01:00
Raymond Hettinger
741c6386b8
Minor doc edit: Make multinomial() the first math example (gh-132697)
2025-04-18 12:41:13 -05:00
Raymond Hettinger
818b6a9ead
Fix argument order in multinomial() example (gh-132557)
2025-04-15 11:50:52 -05:00
AN Long
798f8d3ea9
Replace non-breaking spaces with normal spaces ( #130116 )
...
Using normal spaces in place of non-breaking spaces.
2025-02-16 09:33:14 +08:00
Raymond Hettinger
e1e85204ed
Add multinomial to the itertools recipes docs (gh-129760)
2025-02-06 18:35:55 -06:00
Gugubo
e4981e33b8
Fix typo in itertools docs (gh-127995)
2024-12-16 11:08:25 -06:00
Raymond Hettinger
292067fbc9
Minor readability improvements for the itertools recipes (gh-127928)
2024-12-13 12:12:49 -06:00
Raymond Hettinger
8bbd379ee3
Simplify and speed-up an itertools recipe (gh-127848)
2024-12-11 21:24:56 -06:00
Raymond Hettinger
7f882c88cf
Itertool recipe additions (gh-127483)
2024-12-03 18:20:01 -06:00
Raymond Hettinger
b2a7272408
Misc improvements to the itertools docs (gh-125147)
2024-10-08 14:02:58 -05:00
Raymond Hettinger
2e155536ca
Itertool docs: Minor clarifications, wording tweaks, spacing, and active voice. (gh-124690)
...
Minor clarifications, wording tweaks, spacing, and active voice.
2024-09-27 18:43:46 +00:00
Raymond Hettinger
909c6f7189
gh-123884 Tee of tee was not producing n independent iterators (gh-124490)
2024-09-25 13:38:05 -07:00
Raymond Hettinger
2afba5ca6d
Small improvements to the itertools docs (GH-123885)
2024-09-09 20:57:49 -05:00
Serhiy Storchaka
1a0c7b9ba4
gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907)
2024-07-19 08:06:02 +00:00
Frank Dana
79e09e60d8
itertools doc: examples for groupby() and tee() ( #120618 )
2024-06-17 08:19:14 -05:00
Raymond Hettinger
63111bfcf0
Add unique() recipe to itertools docs (gh-119911)
2024-06-01 11:30:24 -05:00
Raymond Hettinger
0bd0d4072a
Misc cleanups and wording improvements for the itertools docs (gh-119626)
2024-05-27 13:22:57 -05:00
Raymond Hettinger
49c3ade4f3
Misc improvement to the docs for itertools (gh-119529)
2024-05-24 16:58:24 -05:00
Raymond Hettinger
81c3130c51
Minor improvements to the docs for itertools.tee() (gh-119135)
2024-05-18 01:32:34 -05:00
Raymond Hettinger
7a97ee570f
Misc improvements to the itertools docs (gh-119040)
2024-05-14 10:18:19 -05:00
pochmann3
a705c1e449
Itertools docs: fix parameter names and indentation in Python equivalents (gh-118977)
2024-05-12 16:11:38 -05:00
Ned Batchelder
bcb435ee8f
docs: module page titles should not start with a link to themselves ( #117099 )
2024-05-08 20:34:40 +01:00
Raymond Hettinger
c7c9b913c0
gh-118476: Fix corner cases in islice() rough equivalent. (Gh-118559)
2024-05-05 01:42:30 -05:00
Raymond Hettinger
6d9e8e989e
Minor improvements to the itertools recipes ( #118563 )
2024-05-03 17:07:47 -05:00
Hugo van Kemenade
3375282bb8
Docs: add link roles with Sphinx extlinks ( #117850 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-04-15 21:22:00 +03:00
Raymond Hettinger
41e844a4ac
gh-116842: Improve test comment and fix a doctest (gh-116846)
2024-03-14 21:40:36 -05:00
Raymond Hettinger
ab9e322ae1
Minor improvements to the itertools documentation (gh-116833)
2024-03-14 16:39:50 -05:00
Raymond Hettinger
5ff012a449
Better presentation order for recipes. (gh-116755)
2024-03-13 15:02:56 -05:00
Raymond Hettinger
e82f6dfae5
Modernize roundrobin() recipe and improve variable names (gh-116710)
2024-03-13 02:12:30 -05:00
Raymond Hettinger
93a687a373
Minor clarity improvement for the iter_index() recipe. Also add value subsequence tests. (gh-116696)
2024-03-12 21:33:42 -05:00
Raymond Hettinger
126186674e
Beef-up tests for the itertool docs. (gh-116679)
2024-03-12 17:19:58 -05:00
Raymond Hettinger
15dc2979bc
Consistently spell out *predicate* instead of *pred*. (gh-116308)
2024-03-04 15:51:29 +00:00
Raymond Hettinger
a81d9509ee
Make the iter_except() recipe more compact. (gh-116132)
...
Only one example is needed
2024-02-29 11:30:18 -06:00
Raymond Hettinger
f484a2a748
Update an out-of-date example in the itertools recipe intro (gh-116082)
2024-02-28 17:11:05 -06:00
Raymond Hettinger
67c19e57b5
Improve all_equal() recipe (gh-116081)
...
Replace conjuction of next() calls with simpler len()/take() logic. Add key function.
2024-02-28 17:04:56 -06:00
Raymond Hettinger
a0a8d9ffe0
gh-113479: Link to workaround for subtle issue with takewhile() (gh-115890)
2024-02-25 06:32:14 -06:00
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