I want to visualize the following dict of dicts
players_info = {'Afghanistan': {'Asghar Stanikzai': 809.0,
'Mohammad Nabi': 851.0,
'Mohammad Shahzad': 1713.0,
'Najibullah Zadran': 643.0,
'Samiullah Shenwari': 774.0},
'Australia': {'AJ Finch': 1082.0,
'CL White': 988.0,
'DA Warner': 1691.0,
'GJ Maxwell': 822.0,
'SR Watson': 1465.0},
'England': {'AD Hales': 1340.0,
'EJG Morgan': 1577.0,
'JC Buttler': 985.0,
'KP Pietersen': 1176.0,
'LJ Wright': 759.0}}
Currently I am using the following way but with large dict it is making a clutter which I don't want.
import pandas as pd
import matplotlib.pyplot as plt
pd.DataFrame(players_info).plot.bar()
plt.show()
Please suggest a better way of visualizing it. Thanks
You first need a better dataframe structure out of your dict.
Then, you may use the plotting like below:
Output:
I suggest using
heatmap
.Output: