| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 29 | 30 | 31 |
- string
- GIT
- gas
- PostgreSQL
- Presto
- PANDAS
- Tkinter
- numpy
- PySpark
- Github
- Google Spreadsheet
- google apps script
- Google Excel
- hive
- list
- Redshift
- Java
- django
- Apache
- Excel
- array
- SQL
- dataframe
- Kotlin
- math
- Python
- matplotlib
- c#
- 파이썬
- Today
- Total
목록Python (393)
달나라 노트
os.path.isfile()은 주어진 경로가 파일인지 아닌지를 return합니다. os.path.isfile(directory) 사용법은 위와 같습니다.directory가 파일이라면 True를 return합니다.directory가 파일이 아니라면 False를 return합니다. import ostarget_dir = '/Users/Documents/code/pythonProject/gemini_test.py' # 1bool_file_yn = os.path.isfile(target_dir) # 2print(bool_file_yn)-- ResultTrue 1. 체크할 directory를 준비합니다. 2. os.path.isfile() method를 이용하여 directory의 파일 여부를 체크합니다..
간혹 어떤 기준되는 폴더 안에 있는 모든 파일 list를 얻고 싶을 때가 있습니다.근데 단순히 어떤 폴더 안에 담긴 것이 아니라 폴더 속 폴더 속 폴더 속의 파일 같이 다중으로 구성된 directory의 모든 파일 리스트를 얻고싶을 때가 있죠.이때는 iglob를 사용하면 유용합니다. glob.iglob(directory, recursive=True/False) 사용법은 위와 같습니다.잘 모르겠으니 예시를 통해서 알아봅시다. 예시에서의 목적은 다음과 같습니다."내가 원하는 폴더 안에 있는 모든 파일과, 모든 폴더 속에 담긴 파일까지 모두 return하라." import glob# 기준 folderroot_path = '/Users/Documents/code/pythonProject/**' # 1# ..
anaconda를 사용할 때 다양한 environment를 어떻게 활성화하는지 알아봅시다. conda activate environment_name 원하는 interpreter를 활성화할 땐 conda activate 명령어를 사용하면 됩니다. 예시를 봅시다. terminal을 열고 conda env list를 입력하여 현재 제 컴퓨터에 설치된 conda environment를 출력해봅시다.(conda env list 관련 = https://cosmosproject.tistory.com/919) (base) ~ % conda env list# conda environments:#base * /opt/anaconda3dj_project /opt/a..
anaconda에서는 현재 사용중인 interpreter의 정보를 출력하는 기능이 있습니다. conda info terminal을 열고 conda info 명령어를 입력해봅시다. (base) ~ % conda info active environment : base active env location : /opt/anaconda3 shell level : 1 user config file : /Users/me/.condarc populated config files : /Users/me/.condarc conda version : 24.5.0 conda-build version : 24.1.2 python version :..