-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathellipsis.py
41 lines (25 loc) · 872 Bytes
/
ellipsis.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""
) ( (
( /( )\ ) )\ ( ) ) (
)\()) ((_) ( /( ((_) )\ ) ( /( ( ( /( )(
((_)\ _ )(_)) _ (()/( )(_)) )\ )(_)) (()\
| |(_) | | ((_)_ | | )(_)) ((_)_ ((_) ((_)_ ((_)
| '_ \ | | / _` | | | | || | / _` | (_-< / _` | | '_|
|_.__/ |_| \__,_| |_| \_, | \__,_| /__/ \__,_| |_|
|__/
"""
import numpy as npn = np.arange(16).reshape(2,2,2,2)
print(n)
import numpy as np
n = np.arange(16).reshape(2,2,2,2)
print(n[1:,1])
import numpy as np
n = np.arange(16).reshape(2,2,2,2)
print(n[1,...,1])
import numpy as np
n = np.arange(16).reshape(2,2,2,2)
print(n[1,Ellipsis,1])
from numpy import arange
a = arange(16).reshape(2,2,2,2)
print(a[..., 0].flatten())
print(a[:,:,:,0].flatten())