SyntaxFix
Write A Post
Hire A Developer
Questions
Or use pandas,
pandas
Demo:
>>> d={'B':1,'A':2,'C':3} >>> df=pd.DataFrame(d,index=[0]).sort_index(axis=1) A B C 0 2 1 3 >>> df.to_dict('int')[0] {'A': 2, 'B': 1, 'C': 3} >>>
See:
Docs of this Documentation of whole pandas
Docs of this
Documentation of whole pandas