pandas 如何计算列表的最小差值(语言-python)

我有一个dateframe;

hos_date = pd.DataFrame({
    "hos_name" : [1,1,3,2,3,4,5,6,5,4,6,1],
    "date" : ['05-01','05-02','05-05','05-30','05-24','05-18','05-02','05-05','05-30','05-24','05-05','05-30']
})

我需要计算相同的hos_name的date之间的最小差值:
比如预期计算结果hos_name = 1 时,时间的最小差值是 05-02减去05-01 为1天
我该如何做

大概思路:

>>> hos_date = pd.DataFrame({
    "hos_name" : [1,1,3,2,3,4,5,6,5,4,6,1],
    "date" : ['05-01','05-02','05-05','05-30','05-24','05-18','05-02','05-05','05-30','05-24','05-05','05-30']
})
>>> t = hos_date.where(cond = (hos_date['hos_name']==1)).dropna()
>>> t
    hos_name   date
0        1.0  05-01
1        1.0  05-02
11       1.0  05-30
>>> dates = sorted(['2022-'+i for i in t['date']])
>>> def diff(t1,t2):
    y1,m1,d1 = list(time.strptime(t1,'%Y-%m-%d'))[:3]
    y2,m2,d2 = list(time.strptime(t2,'%Y-%m-%d'))[:3]
    result = datetime.date(y2,m2,d2)-datetime.date(y1,m1,d1)
    return result.days

>>> [diff(dates[i],dates[i+1]) for i in range(len(dates)-1)]
[1, 28]
>>>