728x90
반응형
sample_size = 4
sorted_sample = [
mylist[i] for i in sorted(random.sample(range(len(mylist)), sample_size))
]
728x90
반응형
'사소한 Tip . 오류 해결법 > python' 카테고리의 다른 글
[python] 클래스 별 랜덤 컬러 정의 (0) | 2023.08.23 |
---|---|
[streamlit] OSError: [Errno 28] inotify watch limit reached (0) | 2023.08.17 |
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() (0) | 2023.08.01 |
[cv2] contour 사용해서 이미지 내 외부 패딩 삭제 (0) | 2023.06.22 |
[Python/Google translator]구글 번역 API 파이썬 (0) | 2023.06.05 |