Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python plot a dictionary

# credit to the Stack Overflow user in the 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()
Comment

PREVIOUS NEXT
Code Example
Python :: pd if value delete row 
Python :: set axis limits matplotlib 
Python :: python reload module without restarting 
Python :: pickle a dictionary 
Python :: df iterrows pandas 
Python :: django import Q 
Python :: how to find ip address of website using python 
Python :: hwo much does mano house cost in python 
Python :: python removing from string 
Python :: python line chart 
Python :: subtract one hour from datetime python 
Python :: python windows hide files 
Python :: python random number between 1 and 100 
Python :: how to run python script as admin 
Python :: python delete none from list 
Python :: python color in console 
Python :: libGLU.so.1: cannot open shared object file: No such file or directory 
Python :: reverse row order pandas 
Python :: linux ubuntu install python 3.7 
Python :: python requests set user agent 
Python :: pandas percent change 
Python :: convert pandas dataframe to spark dataframe 
Python :: sorting rows and columns in pandas 
Python :: python get current time in seconds 
Python :: python remove cached package 
Python :: set axis title matplotlib 
Python :: convert mp3 to wav python 
Python :: python os if file exists 
Python :: pandas to csv without header 
Python :: pytest skip 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =