Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Python/Module3_IntroducingNumpy/AdvancedIndexing.md
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,13 @@ This will return a tuple of two integer-valued index-arrays. These contain the i
... [ 0.84, 0.76, 0.25, 0.07]])

>>> x[np.arange(4), np.arange(4)] = range(4)
# equivalent (works for the general case of a square matrix of N-dims)
# x[tuple(np.arange(x) for x in x.shape)] = range(x.shape[0])

# equivalent (using numpy built-in functions):
# x[np.diag_indices_from(x)] = np.arange(4)
# np.fill_diagonal(x, np.arange(4))

>>> x[0.8 < x] += 1
>>> x
array([[ 0. , 0.05, 1.84, 0.21],
Expand Down
2 changes: 1 addition & 1 deletion Python/Module4_OOP/Methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ __main__.Dummy
`dict.fromkeys` is an example of a class method that takes in an iterable, and returns a dictionary whose keys are the elements of that iterable, and whose values all default to `None`.

```python
>>> dict.fromkeys("abcd")
>>> dict.fromkeys("abcd", 2.3)
{'a': 2.3, 'b': 2.3, 'c': 2.3, 'd': 2.3}
```

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Once this environment is created activate it. You may need to manually install a

```shell
pip install sphinx-rtd-theme==0.4.3
pip install jupytext-1.3.0rc1
pip install jupytext==1.4.2
```

and install the `plymi` code base from this repo. Clone the present repository and run:
Expand Down