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.3.tar.gz
(2.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file extract-samples-1.0.3.tar.gz.
File metadata
- Download URL: extract-samples-1.0.3.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
504b62da3ccd2db90bf8621cd79b1de1a2201eada5834f8a994d3708dce1e211
|
|
| MD5 |
d5af386331f61778499365e8f95b5ee0
|
|
| BLAKE2b-256 |
c24760f1b10ab3bdae426a0753c76b406ff6c7db44096d42af421c4293c4c512
|
File details
Details for the file extract_samples-1.0.3-py3-none-any.whl.
File metadata
- Download URL: extract_samples-1.0.3-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b3bd9c98980b8ab48f2f4dceeba3d5064afd3e2568ad57bd15e68ca164dbe59
|
|
| MD5 |
881e5fb3252fa34a36cf613807bd3b7e
|
|
| BLAKE2b-256 |
bbd53906f37a39e1b7c5dcb0d8172ca8fe2d09ffd3195ed062c55a0aec42bcca
|