Skip to content
This repository was archived by the owner on Aug 11, 2023. It is now read-only.

Commit 159b4aa

Browse files
committed
Update
1 parent 48553b2 commit 159b4aa

File tree

5 files changed

+57
-3
lines changed

5 files changed

+57
-3
lines changed

lessons/python/modules/numpy/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
- [`np.concatenate(), np.stack(), np.hstack(), np.vstack(), np.dstack()`](numpy_functions.py)
2222
- [`np.nditer(array), np.ndenumerate(array)`](numpy_access.py)
2323
- [`np.copyTo(dst,src)`](numpy_func_copyto.py)
24-
- `sort()`
24+
- [`np.sort(array)`](numpy_func_sort.py)
2525
- Filter
2626
- [Where](numpy_filter_values.py)
2727
- Access
@@ -30,5 +30,5 @@
3030
- [Box](numpy_access_range.py)
3131
- [`.copy()` va `.view()`, `.base`](numpy_access_copy_view.py) <sub>check if returned array is copy or view</sub>
3232
- Math
33-
- `.min()`, `.max()`
34-
- `.sum()`, `.mean()`, `.median()`, `.std()`
33+
- [`np.min()`, `np.max()`](numpy_func_min_max.py)
34+
- [`np.sum()`, `np.mean()`, `np.median()`, `np.std()`, `np.abs()`](numpy_func_sum_mean_med_std.py)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import numpy as np
2+
3+
L = [
4+
[6, 2, 5, 1, 5],
5+
[6, 2, 6, 1, 6],
6+
[6, 2, 7, 1, 7],
7+
[6, 2, 8, 1, 8],
8+
]
9+
N = np.array(L)
10+
11+
print(np.max(N))
12+
print(np.min(N))
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import numpy as np
2+
3+
L = [
4+
[6, 2, 5, 1, 5],
5+
[6, 2, 6, 1, 6],
6+
[6, 2, 7, 1, 7],
7+
[6, 2, 8, 1, 8],
8+
]
9+
N = np.array(L)
10+
print(N)
11+
"""
12+
[[6 2 5 1 5]
13+
[6 2 6 1 6]
14+
[6 2 7 1 7]
15+
[6 2 8 1 8]]
16+
"""
17+
18+
19+
N = np.sort(N)
20+
print(N)
21+
"""
22+
[[1 2 5 5 6]
23+
[1 2 6 6 6]
24+
[1 2 6 7 7]
25+
[1 2 6 8 8]]
26+
"""
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import numpy as np
2+
3+
L = [
4+
[6, 2, -5, 1, 5],
5+
[6, 2, -6, 1, 6],
6+
[6, 2, -7, 1, 7],
7+
[6, 2, -8, 1, 8],
8+
]
9+
N = np.array(L)
10+
11+
print(np.mean(N))
12+
print(np.median(N))
13+
print(np.std(N))
14+
print(np.sum(N))
15+
print(np.abs(N))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1

0 commit comments

Comments
 (0)