Feb-26-2022, 12:57 PM
Hi everyone,
I've a difficulties with my project, I'm a novice in Python. I would like sort my column "TypeDOC" in descending order but it's not possible because of my index I think. Would you have an idea to solve my problem ?
I've a difficulties with my project, I'm a novice in Python. I would like sort my column "TypeDOC" in descending order but it's not possible because of my index I think. Would you have an idea to solve my problem ?
df3 = pd.DataFrame(data=list(liste01.typeconsultation), index=liste01.iddoc, columns=['TypeDOC']) df3 = df3[df3['TypeDOC'] == 'document'] df3['IdDOC'] = df3.index tableau4 = pd.pivot_table(df3, index='IdDOC', values='TypeDOC', aggfunc='count') tableau4.sort_values(by = 'TypeDOC') tableau4Thanks to all those who will take the time to answer me !