python – Pivoted df and the column order

I sorted my data frame by date and then rotated the data frame, but the rotated data frame is not in the order that I asked before.

df1 = df1.sort_values ​​(by = (& # 39; DATE & # 39;))

df2 = df1.pivot (index = CL CLIENT,, columns = (VIS VISIT_N,), values ​​= D DATE #)

Are there any parameters in Pivot that can help maintain the order? Can you guess?