Skip to content

Commit 91e7b06

Browse files
author
Joseph Luce
authored
Create itertools.md
1 parent b6d2ec5 commit 91e7b06

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

Diff for: pythonic/itertools.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Itertools
2+
This section will go over a few tools in python 3's itertools library.
3+
4+
## count()
5+
6+
## cycle()
7+
8+
## repeat()
9+
10+
## accumulate()
11+
12+
## chain()
13+
14+
## compress()
15+
16+
## groupby()
17+
Requires that the iterable is sorted by the value you are grouping by.
18+
19+
## dropwhile()
20+
21+
## islice()
22+
23+
## starmap()
24+
Used for when you have an iterable of iterables.
25+
26+
```
27+
data = [(2,5), (1,2), (7,3)]
28+
for each in itertools.starmap(operator.mul, data)
29+
print(each)
30+
31+
10
32+
2
33+
21
34+
```
35+
36+
## tee()
37+
38+
## zip_longest()
39+
40+
## combinations()
41+
42+
## permutations()
43+
44+
## combinations_with_replacement()
45+
46+
## product()

0 commit comments

Comments
 (0)