用日期排序数据框作为熊猫中的列标题

我的约会必须是在水年中,所以我想找到一种方法,使该列的开始日期为09/30 / 1899_24:00,然后结束日期为9/30 / 1999_24:00。

enter image description here

Initially I had it like this (picture below) but when I did the dataframe pivot it messed up the order. enter image description here

这是我的代码片段

    sim = pd.read_csv(headout,parse_dates=True, index_col='date')
    sim['Layer'] = sim.groupby('date').cumcount() + 1
    sim['Layer'] = 'L' + sim['Layer'].astype(str)
    sim = sim.pivot(index = None , columns = 'Layer').T
    sim = sim.reset_index() 
    sim = sim.rename(columns={"level_0": "NodeID"})
    sim["NodeID"]= sim['NodeID'].astype('int64')
    sim = sim.sort_index(axis=1, ascending=False)
    sim['gse'] = sim['NodeID'].map(sta.set_index(['NodeID'])['GSE'])