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 |
Tags
- 덴드로그램
- 분류 결과표
- 최솟값
- count()
- wcss
- 반복문
- Machine Learning
- data
- string
- list
- Python
- del
- Dictionary
- DataFrame
- insert()
- sklearn
- len()
- function
- hierarchical_clustering
- elbow method
- nan
- numpy
- matplotlib
- dendrogram
- 최댓값
- DataAccess
- IN
- pandas
- append()
- analizer
Archives
- Today
- Total
개발공부
[Python] parse, 문자열 날짜를 datetime으로 변경 본문
dateutil.parser의 parse를 이용하면 문자열로 되어있는 날짜를 파이썬이 계산할 수 있도록 변경이 가능하다.
from dateutil.parser import parse
기본 사용법은 아래와 같다.
>>> date_str = '2022-05-08'
>>> someday = parse(date_str)
>>> someday
datetime.datetime(2022, 5, 8, 0, 0)
>>> someday.weekday()
6
>>> parse('2022/06/30')
datetime.datetime(2022, 6, 30, 0, 0)
'Python > Basic' 카테고리의 다른 글
| [Python] 구글 맵(google maps) API - Geocoding API 설정하는 방법 (0) | 2022.05.04 |
|---|---|
| [Python] relativedelta를 이용해 날짜 연산하기 (0) | 2022.04.27 |
| [Python] time 모듈을 이용한 UTC시간, Local 시간 (0) | 2022.04.27 |
| [Python] 날짜 / 시간을 처리할 수 있는 datetime 모듈 (0) | 2022.04.27 |
| [Python] 랜덤(Random) 라이브러리의 함수들 (0) | 2022.04.27 |