Note
Numpy (10) 본문
728x90
How to generate custom sequences in numpy without hardcoding?
a = np.array([1,2,3])
np.r_[np.repeat(a, 3), np.tile(a, 3)]
# output
array([1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3])
'Numpy' 카테고리의 다른 글
Numpy (12) (0) | 2022.08.02 |
---|---|
Numpy (11) (0) | 2022.07.31 |
Numpy (9) (0) | 2022.07.29 |
Numpy (8) (0) | 2022.07.28 |
Numpy (7) (0) | 2022.07.27 |
Comments