利用python对某衣服品牌的价格分析

# -*- coding: utf-8 -*-import jsonimport numpy as npfrom pylab import *path="semir_2015_1_3.txt"records=[json.loads(line) for line in open(path)]print "the sumof records:",len(records)manPrice=np.array([float(record["view_price"]) for record in records if record["raw_title"].find(u"男")!=-1 and record["raw_title"].find(u"女")==-1])womanPrice=np.array([float(record["view_price"]) for record in records if record["raw_title"].find(u"男")==-1 and record["raw_title"].find(u"女")!=-1])manPrice.sort()womanPrice.sort()plot(manPrice,label="man")plot(womanPrice,label="woman")legend(loc='upper left')show()结果

,生命中,每一种苦难的背后都有一片晴朗的天空

利用python对某衣服品牌的价格分析

相关文章:

你感兴趣的文章:

标签云: