链接:https://github.com/jackiekazil/data-wrangling    ,未经允许,不得将数据提供给第三方

 

本人代码示例:

import xlrd
import matplotlib.pyplot as plt
import numpy as np
book = xlrd.open_workbook("corruption_perception_index.xls")

sheet = book.sheet_by_name("CPI 2013")

data = {}
cc=[]
country1=[]
for i in xrange(3,sheet.nrows):

    # Start at 14th row, because that is where the countries begin
    row = sheet.row_values(i)

    country = row[1]
    cc.append(row[5])
    data[country] = {
        'child_labor': {
            'rank': row[5],
            'score': row[6]

        }
    }
    print  type(row[5])




print len(cc)
print cc
for key in data:
    print key


import pprint
pprint.pprint(data)
plt.bar(range(len(cc)), cc, align = 'center',color='steelblue', alpha = 0.8)
plt.xticks(range(len(cc)),list(data.keys()))
plt.ylabel('GDP')
plt.show()

效果图: