random sample each file path
Project description
overview
- 폴더 별로 필요한 파일 수를 추출하는 함수
Args:
folder_list (list): 파일 경로 목록
count_list (list): 폴더 별로 추출할 파일 수 목록
path_count (int): 경로를 구성하는 '/' 개수
Returns:
list: 추출된 파일 경로 목록
Example:
위와 같은 경로가 있을 때
"최하위 폴더에서 1개씩 가져온다."라는 조건이라면
extract_sample(file_path_list, [1], 3)
"object1-1에 존재하는 파일 중 랜덤으로 1개를 가져온다."라는 조건이라면
extract_sample(file_path_list, [1], 2)
"object1-1-1 >> 2개
object1-1-2 >> 3개
object1-1-3 >> 1개
순으로 가져온다."라는 조건이라면
extract_sample(file_path_list, [2, 3, 1], 3)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
extract-samples-1.0.1.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for extract_samples-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2489e4ec4447d26ccec5483e70287a0c6756da3a6d70b0ce7f22277bdfd5bdc5 |
|
MD5 | e0b69a6e98e3afa04ea0c70c5b8e7f77 |
|
BLAKE2b-256 | f4d71ed92c38a625fe17163ee1734c5af1b97f13a8ea515f7ce923c490511d06 |