sujal revised this gist . Go to revision
1 file changed, 10 insertions
q22.py(file created)
@@ -0,0 +1,10 @@ | |||
1 | + | # Using NumPy, write a program to create 1-dimensional array, load it with numbers, and perform the operation of | |
2 | + | # iteration and slicing on it. | |
3 | + | ||
4 | + | import numpy as np | |
5 | + | ||
6 | + | print(arr := np.array([2, 3, 4, 1, 7, 6])) | |
7 | + | for e in np.nditer(arr): | |
8 | + | print(e, end=" ") | |
9 | + | print() | |
10 | + | print(arr[2:5]) |
Newer
Older