μΌ | μ | ν | μ | λͺ© | κΈ | ν |
---|---|---|---|---|---|---|
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 |
- λ°μ΄ν°λΆμμ€μ λ¬Έκ°
- datascience
- λ°μ΄ν°λΆμ
- λ 립νλ³Έ
- ν μ€νΈλΆμ
- Python
- λμνλ³Έ
- LDA
- νμ΄μ¬
- dataframe
- μ€λ²μνλ§
- μΈλμνλ§
- iloc
- λΉ λ°μ΄ν°
- μ£Όμ±λΆλΆμ
- μλν΄λΌμ°λ
- κ΅°μ§ν
- ADP
- pandas
- ν¬λ‘€λ§
- λΉ λ°μ΄ν°λΆμκΈ°μ¬
- opencv
- numpy
- DBSCAN
- ADsP
- Lambda
- t-test
- λ°μ΄ν°λΆμμ λ¬Έκ°
- λ°μ΄ν°λΆκ· ν
- PCA
Data Science LAB
[Python] νμλλ ν 리 κ²μ λ³Έλ¬Έ
μ§λ ν¬μ€ν μμλ globλ₯Ό μ¬μ©νμ¬ λͺ¨λ νμ λλ ν 리μ νμΌμ λΆλ¬μμλ€.
2022.04.13 - ν΄λ μμ νμΌ νλ²μ λΆλ¬μ€κΈ°
ν΄λ μμ νμΌ νλ²μ λΆλ¬μ€κΈ°
ν΄λμμ μ‘΄μ¬νλ μ¬λ¬ νμΌμ νλ²μ λΆλ¬μ€κΈ° import glob folders = glob.glob('ν΄λκ²½λ‘') ν΄λ μμ μ‘΄μ¬νλ λͺ¨λ ν΄λμ νμΌμ νλ²μ λΆλ¬μ€κΈ° folders = ('첫λ²μ§Έ ν΄λ κ²½λ‘\*') ν΄λ μμ νμΌ μ€
suhye.tistory.com
μ΄λ² ν¬μ€ν μμλ osλͺ¨λμ μ¬μ©νμ¬ λͺ¨λ νμ λλ ν 리μ νμΌμ λΆλ¬μ€λ €κ³ νλ€.
1. λͺ¨λ νμ ν΄λ 리μ€νΈ λΆλ¬μ€κΈ°
import os
dir_path = "μ°Ύκ³ μνλ κ²½λ‘"
for (root, directories, files) in os.walk(dir_path):
for directory in directories:
d_path = os.path.join(root, directory)
print(d_path)
2. λͺ¨λ νμ νμΌ λ¦¬μ€νΈ λΆλ¬μ€κΈ°
for (root, directories, files) in os.walk(dir_path):
for file in files:
file_path = os.path.join(root, file)
print(file_path)
3. νΉμ νμμ νμΌ λΆλ¬μ€κΈ°
for (root, directories, files) in os.walk(dir_path):
for file in files:
if '.json' in file:
file_path = os.path.join(root, file)
print(file_path)
μ΅κ·Ό κ°μ₯ λ§μ΄ μ¬μ©νλ νμΌμ νμμ΄ jsonμ΄κΈ° λλ¬Έμ νμ₯μκ° jsonμΈ μ½λλ₯Ό μμ±νλ€.
csv, txt λ±λ± λ€μν νμΌ νμμ λΆλ¬μ¬ μ μλ€.
'π Python > κΈ°μ΄' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[MacOS] Macμμ Visual Studio Code νμ΄μ¬ μ€μΉ λ°©λ² (0) | 2022.09.13 |
---|---|
[Python] νμ΄μ¬ assert ( κ°μ μ€μ ) (0) | 2022.09.07 |
[Python] λͺ λ Ήν μΈμλ°κΈ°(sys.argv) (0) | 2022.04.27 |
[Python]qrcode λͺ¨λμ μ΄μ©ν λΈλ‘κ·Έ qr μ½λ μμ± (0) | 2022.04.25 |
ν΄λ μμ νμΌ νλ²μ λΆλ¬μ€κΈ° (0) | 2022.04.13 |