Skip to content

Commit c050fa6

Browse files
committed
mix sorted description, itertools callout boxes, vstack->hstack
1 parent 2e00f36 commit c050fa6

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

Python/Module2_EssentialsOfPython/Iterables.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
"Here are some useful built-in functions that accept iterables as arguments:\n",
3535
"\n",
3636
" - `list`, `tuple`, `dict`, `set`: construct a list, tuple, [dictionary](https://www.pythonlikeyoumeanit.com/Module2_EssentialsOfPython/DataStructures_II_Dictionaries.html), or [set](https://www.pythonlikeyoumeanit.com/Module2_EssentialsOfPython/DataStructures_III_Sets_and_More.html#The-%E2%80%9CSet%E2%80%9D-Data-Structure), respectively, from the contents of an iterable\n",
37-
" - `sum`: sum the contents of an iterable\n",
38-
" - `sorted`: return a list of the sorted contents of a function\n",
37+
" - `sum`: sum the contents of an iterable.\n",
38+
" - `sorted`: return a list of the sorted contents of an interable\n",
3939
" - `any`: returns `True` and ends the iteration immediately if `bool(item)` was `True` for *any* item in the iterable.\n",
4040
" - `all`: returns `True` only if `bool(item)` was `True` for *all* items in the iterable.\n",
4141
" - `max`: return the largest value in an iterable.\n",

Python/Module2_EssentialsOfPython/Itertools.ipynb

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,24 @@
99
"\n",
1010
"Actually, there are three functions that belong in itertools, but are so useful that they are included in Python by default, and do not need to be imported. It is essential that `range`, `enumerate`, and `zip` become tools that you are comfortable using.\n",
1111
"\n",
12-
"#### `range`\n",
12+
"**range**\n",
13+
"\n",
1314
"generate a sequence of integers in the specified \"range\":\n",
1415
"```python\n",
1516
"# will generate 0.. 1.. 2.. ... 8.. 9\n",
1617
"range(10)\n",
1718
"```\n",
1819
"\n",
19-
"#### `enumerate`\n",
20+
"**enumerate**\n",
21+
"\n",
2022
"\"enumerate\" the items in an iterable:\n",
2123
"```python\n",
2224
"# will generate (0, 'apple').. (1, 'banana').. (2, 'cat').. (3, 'dog')]\n",
2325
"enumerate([\"apple\", \"banana\", \"cat\", \"dog\"])\n",
2426
"```\n",
2527
"\n",
26-
"#### `zip`\n",
28+
"**zip**\n",
29+
"\n",
2730
"\"zip\" together the corresponding elements of several iterables into tuples:\n",
2831
"```python\n",
2932
">>> names = [\"Angie\", \"Brian\", \"Cassie\", \"David\"]\n",
@@ -37,7 +40,8 @@
3740
"***\n",
3841
"The following are some of the many useful tools provided by the `itertools` module:\n",
3942
"\n",
40-
"#### `itertools.chain`\n",
43+
"**itertools.chain**\n",
44+
"\n",
4145
"\"chain\" together multiple iterables, end-to-end:\n",
4246
"```python\n",
4347
">>> from itertools import chain\n",
@@ -51,7 +55,7 @@
5155
"<itertools.chain at 0x20de109ec18>\n",
5256
"```\n",
5357
"\n",
54-
"#### `itertools.combinations`\n",
58+
"**itertools.combinations**\n",
5559
"Generate all length-n \"combinations\" from an iterable:\n",
5660
"```python\n",
5761
">>> from itertools import combinations\n",
@@ -66,26 +70,26 @@
6670
"cell_type": "markdown",
6771
"metadata": {},
6872
"source": [
69-
"***\n",
73+
"<div class=\"alert alert-info\">\n",
7074
"\n",
7175
"**Reading Comprehension: Itertools I**\n",
7276
"\n",
7377
"Using the `itertools.combinations` function, find the probability that two randomly drawn items from the list `[\"apples\", \"bananas\", \"pears\", \"pears\", \"oranges\"]` would yield a combination of \"apples\" and \"pears\".\n",
7478
"\n",
75-
"***"
79+
"</div>"
7680
]
7781
},
7882
{
7983
"cell_type": "markdown",
8084
"metadata": {},
8185
"source": [
82-
"***\n",
86+
"<div class=\"alert alert-info\">\n",
8387
"\n",
8488
"**Reading Comprehension: Itertools II**\n",
8589
"\n",
8690
"Given the list `x_vals = [0.1, 0.3, 0.6, 0.9]`, create a generator, `y_gen`, that will generate the y-value $y = x^2$ for each value of $x$. Then, using `zip`, create a list of the $(x, y)$ pairs, each pair stored in a tuple.\n",
8791
"\n",
88-
"***"
92+
"</div>"
8993
]
9094
},
9195
{

Python/Module3_IntroducingNumpy/FunctionsForCreatingNumpyArrays.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@
208208
" [-1, -2, -3]])\n",
209209
"\n",
210210
"# stack `x` and `y` \"horizontally\"\n",
211-
">>> np.vstack([x, y])\n",
211+
">>> np.hstack([x, y])\n",
212212
"array([ 1, 2, 3, -1, -2, -3])\n",
213213
"```\n",
214214
"\n",

Python/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
# built documents.
6060
#
6161
# The short X.Y version.
62-
version = '0.10.1'
62+
version = '0.10.2'
6363
# The full version, including alpha/beta/rc tags.
64-
release = '0.10.1'
64+
release = '0.10.2'
6565

6666
# The language for content autogenerated by Sphinx. Refer to documentation
6767
# for a list of supported languages.

0 commit comments

Comments
 (0)