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
4 changes: 2 additions & 2 deletions NumPy/Array Basics/Create an Empty Array/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ NumPy offers several functions to create arrays with initial placeholder content
- 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
depends on the state of the memory.

<div class="hint">
<details>

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),
but it can be specified otherwise with the keyword argument `dtype`.
</div>
</details>

```python
a = np.zeros((3, 4))
Expand Down
4 changes: 2 additions & 2 deletions NumPy/Array Indexing and Slicing/Indexing Basics/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ Basic slicing occurs when obj is a slice object (constructed by `start:stop:step
of brackets), an integer, or a tuple of slice objects and integers. All arrays generated by
basic slicing are always [views](https://numpy.org/doc/stable/glossary.html#term-view) of the original array.

<div class="hint">
<details>

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

1-D array:
```python
Expand Down
4 changes: 2 additions & 2 deletions NumPy/Array Math/Linear Algebra/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Output:
[ 0 40]]
```

<div class="hint">
<details>

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

Matrix multiplication is arguably the most important and widely used operation in machine learning.
It is used in linear regression, various kinds of neural networks, and other approaches.
Expand Down
4 changes: 2 additions & 2 deletions NumPy/Transposing Sorting Concatenating/Sort/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ and [`numpy.ndarray.sort`](https://numpy.org/doc/stable/reference/generated/nump
the only difference being that the former returns a sorted copy of an array, while the latter is used
to sort in-place.

<div class="hint">
<details>

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

```python
a = np.array([[1, 4], [3, 1]])
Expand Down