To generate basic bar graphs using python
Question: I am a newbie to python. Please help me with this error.My idea is to generate
a bar chart between cancer types and females. whereas, cancers on x-axis and
females on the y-axis.In my dataset list of cancers are in a first column and
females in second column. My code goes here:

    
    
    from pylab import *
    import csv
    import sys
    import matplotlib
    import matplotlib.pyplot as plt
    
    cancers = [] 
    females = []
    
    readFile = open('DeathEst.csv', 'r').read()
    eachLine = readFile.split('\n')
    

for line in eachLine:

    
    
      split = line.split(';')
      cancers.append(split[0])
      females.append(split[0])
    
    pos = arange(len(cancers))+.5
    barh(pos, females, align='center', color='#b8ff4c')
    yticks(pos,name)
    plt.show()
    
    
    Error:
    Traceback (most recent call last):
    File "death.py", line 20, in <module>
      barh(pos, females, align='center', color='#b8ff4c')
     File "C:\Users\.....\Desktop\Python34\lib\sitepackages\matplotlib\pyplot.py", line 2533, in barh
     ret = ax.barh(bottom, width, height=height, left=left, **kwargs)
    File "C:\Users\......\Desktop\Python34\lib\sitepackages\matplotlib\axes.py", line 5180, in barh
     bottom=bottom, orientation='horizontal', **kwargs)
    File "C:\Users\......\Desktop\Python34\lib\sitepackages\matplotlib\axes.py", line 5047, in bar
     if w < 0:
     TypeError: unorderable types: str() < int()
    


Answer: Your lists named cancers and females are both holding string elements, and not
integers. Matplotlib doesn't know what to do with that.

