import pandas as pd
import numpy as np
table = pd.DataFrame()
table["SORT_WW"]= ["03", "50", "01", "52", "03", "48", "02", "47"]
table ["Name"] = ["a", "b", "c", "d", "e", "f", "g", "h"]
And my current table is like:
Order I need:
SORT_WW_reorder = pd.Categorical(['45', '44', '46', '47', '48', '49', '50','51', '52', '53', '01', '02', '03', '04', '05', '06', '07'], ordered = True)
What I tried after reading on Stackoverflow answers:
SORT_WW_reorder = pd.Categorical(['45', '44', '46', '47', '48', '49', '50','51', '52', '53', '01', '02', '03', '04', '05', '06', '07'], ordered = True)
table.reindex(SORT_WW_reorder)
It does not do anything once I click on the dataframe "table" on Spyder (the image I shared is same = order is same, did not update). What am I missing?