[优达 机器学习入门]课程6:数据集与问题
其他
2018-06-15 05:08:01
阅读次数: 3
##安然数据集的大小
##安然数据集中的特征
print(len(enron_data["SKILLING JEFFREY K"]))
##在安然数据中查找 POI
print(len(dict ((key,value) for key,value in enron_data.items() if value['poi']==1)))
##存在多少 POI?
with open("./tools/poi_names.txt", "r") as poi_reader:
fr=poi_reader.readlines();
print(len(fr[2:]))
##查询数据集 1
print(enron_data["PRENTICE JAMES"]["total_stock_value"])
##查询数据集 2
print(enron_data["COLWELL WESLEY"]["from_this_person_to_poi"])
##查询数据集 3
print(enron_data["SKILLING JEFFREY K"]["exercised_stock_options"])
转载自blog.csdn.net/daisy_fight/article/details/80677021