Skip to content

Commit da9a8e3

Browse files
committed
Replaced fake hints with <details>
1 parent 713d26b commit da9a8e3

File tree

4 files changed

+15
-13
lines changed
  • NumPy
    • Array Basics/Create an Empty Array
    • Array Indexing and Slicing/Indexing Basics
    • Array Math/Linear Algebra
    • Transposing Sorting Concatenating/Sort

4 files changed

+15
-13
lines changed

NumPy/Array Basics/Create an Empty Array/task.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ NumPy offers several functions to create arrays with initial placeholder content
88
- the function [`empty`](https://numpy.org/doc/stable/reference/generated/numpy.empty.html#numpy.empty) creates an array where the initial content is random and
99
depends on the state of the memory.
1010

11-
<div class="hint">
11+
12+
<details>
1213

1314
By default, the `dtype` of an array created in such a way is [`float64`](https://numpy.org/doc/stable/reference/arrays.scalars.html?highlight=float64#numpy.float64),
1415
but it can be specified otherwise with the keyword argument `dtype`.
15-
</div>
16+
</details>
1617

1718
```python
1819
a = np.zeros((3, 4))

NumPy/Array Indexing and Slicing/Indexing Basics/task.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ Basic slicing occurs when obj is a slice object (constructed by `start:stop:step
3737
of brackets), an integer, or a tuple of slice objects and integers. All arrays generated by
3838
basic slicing are always [views](https://numpy.org/doc/stable/glossary.html#term-view) of the original array.
3939

40-
<div class="hint">
40+
<details>
4141

42-
NumPy slicing creates a view instead of a copy as in the case of built-in Python
43-
sequences such as string, tuple, and list. Care must be taken when extracting a
44-
small portion from a large array that becomes useless after the extraction
45-
because the small portion extracted contains a reference to the large original
46-
array, whose memory will not be released until all arrays derived from it are
42+
NumPy slicing creates a view instead of a copy as in the case of built-in Python
43+
sequences such as string, tuple, and list. Care must be taken when extracting a
44+
small portion from a large array that becomes useless after the extraction
45+
because the small portion extracted contains a reference to the large original
46+
array, whose memory will not be released until all arrays derived from it are
4747
garbage-collected. In such cases, an explicit `copy()` is recommended.
48-
</div>
48+
</details>
4949

5050
1-D array:
5151
```python

NumPy/Array Math/Linear Algebra/task.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ Output:
3838
[ 0 40]]
3939
```
4040

41-
<div class="hint">
41+
<details>
42+
<summary><code>numpy.matmul</code></summary>
4243

4344
There's also the [`numpy.matmul(a, b)`](https://numpy.org/doc/stable/reference/generated/numpy.matmul.html)
4445
function (shorthand: `@`). `matmul` differs from `dot` in two important ways:
@@ -57,7 +58,7 @@ Output:
5758
[[ 0 20]
5859
[ 0 40]]
5960
```
60-
</div>
61+
</details>
6162

6263
Matrix multiplication is arguably the most important and widely used operation in machine learning.
6364
It is used in linear regression, various kinds of neural networks, and other approaches.

NumPy/Transposing Sorting Concatenating/Sort/task.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ and [`numpy.ndarray.sort`](https://numpy.org/doc/stable/reference/generated/nump
55
the only difference being that the former returns a sorted copy of an array, while the latter is used
66
to sort in-place.
77

8-
<div class="hint">
8+
<details>
99

1010
Various sorting algorithms can be used with these methods (see the documentation); they differ in
1111
their average speed, worst-case performance, work space size, and stability.
1212
The default is [quicksort](https://en.wikipedia.org/wiki/Quicksort).
13-
</div>
13+
</details>
1414

1515
```python
1616
a = np.array([[1, 4], [3, 1]])

0 commit comments

Comments
 (0)