我有下面的数据集:
import pandas as pd
df = pd.DataFrame([['x','iii-2019-10-16','18/07/2019'],
['x','iii-2019-10-16','21/04/2019'],
['x','iii-2019-10-16','12/09/2019'],
['x','zzz-2020-10-25','12/04/2022'],
['y','qqq-2018-05-28','10/12/2020'],
['y','qqq-2018-05-28','15/02/2018'],
['y','ooo-2019-11-22','30/05/2019'],
['y','rrr-16-12-2020','16/12/2020'],
['z','ppt-2019-12-03','07/02/2018'],
['z','ttt-2019-12-03','28/05/2019'],
['z','ttt-2019-12-03','09/09/2019'],
['z','ttt-2019-12-03','30/09/2019']
],
columns=['Car_code','customer_rent_code','Rent_Date'])
我需要找到每个car_code条目之间的日期差异,例如car x,但每个car的第一个日期将为空,预期结果将是:
1条答案
按热度按时间1zmg4dgp1#
组内有日期差异: