반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- PANDAS
- numpy
- GIT
- Apache
- PySpark
- django
- Google Spreadsheet
- matplotlib
- hive
- c#
- Tkinter
- Redshift
- PostgreSQL
- string
- Mac
- Java
- Kotlin
- Excel
- math
- 파이썬
- gas
- Google Excel
- Python
- google apps script
- dataframe
- Github
- SQL
- array
- list
Archives
- Today
- Total
목록isocalendar (1)
달나라 노트
Python datetime : isocalendar, strftime('%U'), strftime('%W') (week number 추출)
import datetime dt = datetime.date(2020, 12, 25) print(dt) iso_data = dt.isocalendar() print(iso_data) print(iso_data[0]) # year print(iso_data[1]) # week number print(iso_data[2]) # week day number - Result 2020-12-25 (2020, 52, 5) 2020 52 5 isocalendar는 date or datetime에 대해 해당 날짜의 년도, 주차(week number), 요일(week day)을 포함한 Tuple 데이터를 반환합니다. 따라서 return된 Tuple의 index = 1인 숫자를 보면 week number를 얻을 수 있습..
Python/Python datetime
2020. 12. 23. 03:04