| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- GIT
- Github
- dataframe
- PANDAS
- Java
- Python
- matplotlib
- array
- Redshift
- SQL
- Excel
- gas
- c#
- Apache
- Google Spreadsheet
- string
- math
- Tkinter
- hive
- PySpark
- Presto
- list
- PostgreSQL
- Google Excel
- google apps script
- numpy
- Kotlin
- 파이썬
- django
- Today
- Total
목록Python (387)
달나라 노트
import datetime current_dt = datetime.datetime.now() print(current_dt) - Result 2020-03-08 02:13:52.703621 datetime 모듈의 class중에서 datetime이라는 class가 존재합니다. datetime class에 속한 now라는 moethod는 현재 local date와 time을 리턴합니다. import datetime current_dt = datetime.date.today() print(current_dt) - Result 2020-03-08 datetime 모듈의 class중에서 date라는 class가 존재합니다. date class에 속한 today라는 moethod는 현재 local date를 리턴..
import datetime a = datetime.datetime(12, 34, 56, 12, 34, 56, 123456) b = datetime.datetime(12, 34, 56) print(a) print(b) - Result 2020-03-08 12:34:56.123456 2020-03-08 00:00:00 datetime module에는 datetime이라는 class가 존재합니다. datetime method는 datetime class의 생성자(Constructor)이며 년, 월, 일, 시, 분, 초, 마이크로초의 7개 인자를 받으며 이 중 년, 월, 일은 필수 인자입니다. 만약 입력되지 않은 인자는 모두 0으로 인식되는 것을 위 예시의 b에서 볼 수 있습니다. import datetime..
import datetime a = datetime.time() print(a) b = datetime.time(12, 34, 56) print(b) c = datetime.time(hour = 12, minute = 34, second = 56,) print(c) d = datetime.time(12, 34, 56, 123456) print(d) - Result 00:00:00 12:34:56 12:34:56 12:34:56.123456 datetime module에는 time이라는 class가 존재합니다. time method는 time class의 생성자(Constructor)이며 시간, 분, 초의 세 가지 parameter를 기본적으로 받고, 거기에 추가로 d처럼 1초 미만의 소수점 초까지 par..
import datetime today = datetime.date.today() y = today.year m = today.month d = today.day w = today.weekday() print(y) print(m) print(d) print(w) - Result 2020 3 8 6 datetime 모듈의 date class에 today method를 사용하거나 직접 년, 월, 일을 입력해주어 date 객체를 생성합니다. 이 생성한 date class의 year, month, day attribute를 이용하여 년, 월, 일을 추출할 수 있으며 weekday method를 이용하여 요일별 숫자(월 = 0, 화 = 1, ... 일 = 6)를 얻어낼 수 있습니다.