문제
Find the last time each bike was in use. Output both the bike number and the date-timestamp of the bike's last use (i.e., the date-time the bike was returned). Order the results by bikes that were most recently used.
각 자전거가 마지막으로 사용된 시간 찾기.
자전거 번호와 자전거의 마지막 사용 날짜(자전거가 반환된 날짜) 조회
가장 최근에 사용한 순서로 정렬
코드
# Import your libraries
import pandas as pd
# Start writing code
dc_bikeshare_q1_2012.head()
dc_bikeshare_q1_2012.groupby(['bike_number'])['end_time'].max().sort_values(ascending=False).reset_index()
출처
반응형
'Algorithm > Python' 카테고리의 다른 글
[프로그래머스] 시저 암호 (Python) (0) | 2021.08.20 |
---|---|
[프로그래머스] 직사각형 별찍기 (Python) (0) | 2021.08.20 |
[stratascratch] Churro Activity Date(Python) (0) | 2021.08.19 |
[stratascratch] Customer Details(Python) (0) | 2021.08.15 |
[stratascratch] Order Details(Python) (0) | 2021.08.15 |