I have a dictionary:
dic={\'Tim\':3, \'Kate\':2}
I would like to output it as:
Name Age Tim 3 Kate 2
Is i
You could use pandas.
In [15]: import pandas as pd In [16]: df = pd.DataFrame({'Tim':3, 'Kate':2}.items(), columns=["name", "age"]) In [17]: df Out[17]: name age 0 Tim 3 1 Kate 2