일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- matplotlib
- hive
- gas
- Redshift
- SQL
- 파이썬
- Excel
- django
- string
- PANDAS
- list
- Github
- PostgreSQL
- PySpark
- c#
- array
- Google Excel
- dataframe
- google apps script
- Apache
- Tkinter
- Google Spreadsheet
- Python
- Kotlin
- GIT
- numpy
- Mac
- Java
- math
- Today
- Total
목록Python (384)
달나라 노트
numpy의 exp method는 자연상수(e = 2.71828...)의 지수배에 대한 값을 계산해줍니다. Syntax numpy.exp(n) # --> e^n numpy.exp([k, l, m, n]) # --> [e^k, e^l, e^m, e^n] Syntax는 위와 같으며 parameter로서 단순한 숫자(n) 뿐 아니라 list의 형태로도 전달할 수 있습니다. import numpy as np print(np.exp(0)) # e^0 print(np.exp(1)) # e^1 print(np.exp(2)) # e^2 print(np.exp(3)) # e^3 print(np.exp(4.5)) # e^4.5 print(np.exp([0, 1, 2, 3])) # [e^0, e^1, e^2, e^3] --..
Pandas의 str.contains method는 특정 Series에 적용할 수 있으며 해당 Series에 있는 값들이 어떤 문자열을 포함하고있으면 True, 포함하고있지 않으면 False를 return합니다. Syntax Series.str.contains(string/pattern, case=True/False, regex=True/False) string/pattern : 찾을 문자열 또는 패턴 case : True일 경우 case sensitive(대소문자 구분), False일 경우 case insensitive(대소문자 구분 안함) regex : True일 경우 string/pattern을 regular expression pattern으로 인식. False일 경우 string/pattern을..
Syntax os.path.exists(file_path) os.path.exists는 위처럼 사용 가능합니다. parameter로서 file_path를 받으며 file_path가 실제로 존재하면 True를 존재하지 않으면 False를 반환합니다. |-- test.py |-- test |-- sub_test |-- test.csv # test.py import os print(os.path.exists('test/')) # 1 print(os.path.exists('test/empty_test/')) # 2 print(os.path.exists('test/sub_test/test.csv')) # 3 -- Result True False True 위 예시를 봅시다. python code는 test.py에 ..
python의 내장변수 중 __name__이라는 변수는 해당 python 파일을 직접 실행시키는지 library로 import해서 실행시키는지에 따라 값이 달라집니다. 직접 실행할 경우 -> __name__ == '__main__' library로 import되어 실행된 경우 -> __name__ == '파일명' # name_test.py print(__name__) -- Result __main__ name_test.py 파일을 직접 실행한 경우 __name__이라는 내장변수에는 __main__이라는 값이 저장됩니다. 위 예시의 결과에서 알수있죠. # final.py import name_test -- Result name_test final.py 에서 test.py를 import했습니다. 그리고 fi..