모호한 datetime 찾기
2강의 마지막에서 자전거 주행 시간 데이터에서 이상 현상을 봤어요. 문제가 무엇인지 확인해 보겠습니다.
데이터는 onebike_datetimes로 로드되어 있고, tz는 이미 dateutil에서 임포트되어 있어요.
이 연습은 강의의 일부입니다
Python에서 날짜와 시간 다루기
연습 안내
onebike_datetimes의 주행 기록을 순회하세요:- 시작 시간이 모호한 주행을 모두 출력하세요.
- 종료 시간이 모호한 주행을 모두 출력하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Loop over trips
for trip in onebike_datetimes:
# Rides with ambiguous start
if tz.____(____):
print("Ambiguous start at " + str(trip['start']))
# Rides with ambiguous end
if tz.____(____):
print("Ambiguous end at " + str(trip['end']))