Skip to content

Commit

Permalink
Remove duplicate headers in 'Some Prim. Funcs.'
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigogiraoserrao committed Feb 1, 2022
1 parent 857498e commit 3c88a77
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ this changelog also marks with [n] content that is new in this rework.
## 0.4.1

- Fix typos.
- Fix duplicate headers in “Some Primitive Functions”:
- Under “Axis Specification”, there were 2 almost-consecutive duplicate level 4 headers under the _same_ level 3 header, and it made sense to join them together;
- Rename “Special Notations” to “Replicate with Axis” under the section on replicate, to make the header more explicit;

## v0.4

Expand Down
34 changes: 16 additions & 18 deletions Some-Primitive-Functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5328,23 +5328,6 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Axis Is Like an Operator\n",
"\n",
"The dimension specified within brackets is the axis along which the function is applied.\n",
"\n",
"This produces a derived function, and for this reason, the pair of _axis_ brackets is often called the _axis operator_.\n",
"\n",
"The syntax for _axis_ does not quite follow the general syntax for operators, but it shares all other properties with genuine operators. _Axis_ takes a function as its left operand (the derived function `+/` in the last example above), the dimension specification as its \"right operand\" (3 in the example), and produces a derived function, which is applied to `prod` to calculate the annual sums.\n",
"\n",
"Viewed as an operator, _axis_ is therefore dyadic. It is, however, important to emphasise that its \"right\" operand is not `prod`, it is the expression within the brackets. This is the first example of an operator that takes an array as an operand. We will find some more as we explore operators later on."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Processing Arrays\n",
"\n",
"We shall learn more about _axis_ in [the \"Operators\" chapter](./Operators.ipynb); let us first explore another simple use of this operator.\n",
"\n",
"Suppose that we would like to multiply each of the rows (or columns) of a matrix by different values; we can use _axis_ to specify whether we multiply row-wise or column-wise. First, here is a matrix:"
Expand Down Expand Up @@ -5434,6 +5417,21 @@
"tam×[2]2 5 0 2 1"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Axis Is Like an Operator\n",
"\n",
"The dimension specified within brackets is the axis along which the function is applied.\n",
"\n",
"This produces a derived function, and for this reason, the pair of _axis_ brackets is often called the _axis operator_.\n",
"\n",
"The syntax for _axis_ does not quite follow the general syntax for operators, but it shares all other properties with genuine operators. _Axis_ takes a function as its left operand (the derived function `+/` in the last example above), the dimension specification as its \"right operand\" (3 in the example), and produces a derived function, which is applied to `prod` to calculate the annual sums.\n",
"\n",
"Viewed as an operator, _axis_ is therefore dyadic. It is, however, important to emphasise that its \"right\" operand is not `prod`, it is the expression within the brackets. This is the first example of an operator that takes an array as an operand. We will find some more as we explore operators later on."
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -7848,7 +7846,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Special Notations\n",
"### Replicate with Axis\n",
"\n",
"Like _reduce_ and _catenate_, _replicate_ works along the last dimension of an array by default. However, it is possible for it to work on any dimension by using the _axis_. It is also possible to use `⌿`, which we have already seen, to work on the first dimension by default.\n",
"\n",
Expand Down

0 comments on commit 3c88a77

Please sign in to comment.