Pandas에서 CSV 파일 불러오기
capital_onebike.csv 파일에는 Capital Bikeshare 자전거 W20529의 10월, 11월, 12월 주행 기록이 담겨 있어요.
첫 두 개 열은 다음과 같아요:
| Start date | End date | ... |
|---|---|---|
| 2017-10-01 15:23:25 | 2017-10-01 15:26:26 | ... |
| 2017-10-01 15:42:57 | 2017-10-01 17:49:59 | ... |
이 연습은 강의의 일부입니다
Python에서 날짜와 시간 다루기
연습 안내
- Pandas를 임포트하세요.
read_csv()호출을 완성해Start date와End date열이 날짜로 올바르게 파싱되도록 하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Import pandas
import ____ as pd
# Load CSV into the rides variable
rides = pd.read_csv('capital-onebike.csv',
parse_dates = ____)
# Print the initial (0th) row
print(rides.iloc[0])