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

Commit 48553b2

Browse files
committed
Update
1 parent 378f2c2 commit 48553b2

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

lessons/python/modules/numpy/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@
2020
- [`.reshape()`](numpy_reshape.py)
2121
- [`np.concatenate(), np.stack(), np.hstack(), np.vstack(), np.dstack()`](numpy_functions.py)
2222
- [`np.nditer(array), np.ndenumerate(array)`](numpy_access.py)
23+
- [`np.copyTo(dst,src)`](numpy_func_copyto.py)
24+
- `sort()`
2325
- Filter
2426
- [Where](numpy_filter_values.py)
2527
- Access
2628
- [One Row](numpy_access_one_row.py)
2729
- [One Column](numpy_access_one_column.py)
2830
- [Box](numpy_access_range.py)
2931
- [`.copy()` va `.view()`, `.base`](numpy_access_copy_view.py) <sub>check if returned array is copy or view</sub>
30-
- Math
32+
- Math
33+
- `.min()`, `.max()`
34+
- `.sum()`, `.mean()`, `.median()`, `.std()`
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import numpy as np
2+
3+
L = [
4+
[1, 2, 3, 4, 5],
5+
[1, 2, 3, 4, 6],
6+
[1, 2, 3, 4, 7],
7+
[1, 2, 3, 4, 8],
8+
]
9+
N = np.array(L)
10+
np.copyto(N,0)
11+
print(N)
12+
"""
13+
[[0 0 0 0 0]
14+
[0 0 0 0 0]
15+
[0 0 0 0 0]
16+
[0 0 0 0 0]]
17+
"""
18+
19+
20+
21+
L = [
22+
[1, 2, 3, 4, 5],
23+
[1, 2, 3, 4, 6],
24+
[1, 2, 3, 4, 7],
25+
[1, 2, 3, 4, 8],
26+
]
27+
N = np.array(L)
28+
np.copyto(N,[-1,-2,-3,-4,-5])
29+
print(N)
30+
"""
31+
[[-1 -2 -3 -4 -5]
32+
[-1 -2 -3 -4 -5]
33+
[-1 -2 -3 -4 -5]
34+
[-1 -2 -3 -4 -5]]
35+
"""

0 commit comments

Comments
 (0)