+ +```python +# 时间日期之间的运算 +time_delta = df['date'] - df['date'].shift(1) +print(time_delta) + +# 时间段之间的运算 +period_delta = df['period'] - df['period'].shift(1) +print(period_delta) +``` + +在Pandas中,`set_index()` 函数用于将一个或多个列设置为DataFr...