Pandas > Visualize data

Name
Code
Output
# requires: import matplotlib
dataframe = pandas.DataFrame(numpy.random.randint(0,5,size=(10, 2)), columns=['C1','C2'])
print ("dataframe")
print (dataframe)
print ("dataframe histogram")
print (dataframe.hist())
dataframe
   C1  C2
0   4   4
1   3   3
2   4   4
3   2   0
4   3   0
5   1   2
6   4   1
7   4   1
8   0   3
9   4   4
dataframe histogram
[[<matplotlib.axes._subplots.AxesSubplot object at 0x117585f98>
  <matplotlib.axes._subplots.AxesSubplot object at 0x11762ada0>]]
Display dataframe histogram
# requires: import matplotlib
dataframe = pandas.DataFrame(numpy.random.randint(0,10,size=(5, 2)), columns=['C1','C2'])
print ("dataframe")
print (dataframe)
print ("show plot")
dataframe.plot()
matplotlib.pyplot.show()
dataframe
   C1  C2
0   3   8
1   2   2
2   6   9
3   9   7
4   8   2
show plot
Display dataframe plot