SyntaxFix
Write A Post
Hire A Developer
Questions
A pretty straightforward solution that worked for me is to use .reindex on df.columns:
.reindex
df.columns
df = df[df.columns.reindex(['mean', 0, 1, 2, 3, 4])[0]]