📜  Python 按列表排序数据帧 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:24.599000             🧑  作者: Mango

代码示例1
# sorts the dataframe so resulting order of ColumnName matches order in list
df = df.set_index(ColumnName).reindex(list_to_sort_by).reset_index()