Answers for "pandas line plot dictionary"

0

pandas line plot dictionary

### credit to StackOverflow user in source link

import matplotlib.pylab as plt

lists = sorted(d.items()) # sorted by key, return a list of tuples

x, y = zip(*lists) # unpack a list of pairs into two tuples

plt.plot(x, y)
plt.show()
Posted by: Guest on April-07-2021

Python Answers by Framework

Browse Popular Code Answers by Language