已阅读5页,还剩28页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1 电商销售记录分析严智强 贺强 刘瑞 崔亚松 臧茹歌 2 background 3 contents 4 淘宝网作为国内第一大电商 占有近50 市场份额 而天猫商城则是所有优质店铺的集合 每月会产生大量销售数据 这里以天猫近一个月的手机销售数据进行分析 找出这些数据隐含的价值 天猫手机销售数据分析 5 天猫手机销售数据分析 数据的获取与预处理 替代商品的挖掘 价格空洞的发现 6 数据的获取与处理 天猫销售数据分析 7 构建一个爬虫脚本 从天猫上获取销量前600的手机销售记录 并匹配出每条记录的机型 售价 销量 howtogetthedata 8 爬虫脚本 coding gbkimporturllibimportref1 open r e tmao shoujihtml txt 此处存储了销量前600的网页地址http f1 readlines f1 close f2 open r e tmao shouji txt a foriinhttp content urllib urlopen i strip read f2 write content f2 write n f2 write 50 f2 write n f2 close f3 open r e tmao shouji txt lines forlineinf3 readlines lines line strip f3 close pattern r target blank title result re findall pattern lines f4 open r e tmao shoujiinformation txt w 该文件中存储了每件手机的记录 机型 售价 销量 foriteminresult forjinrange 3 f4 write item j f4 write t f4 write n f4 close 天猫销售数据分析 9 销量 价格散点图 10 天猫销售数据分析 替代商品的挖掘 我们认为 如果两件手机的售价和销量十分接近 则认为这两件手机互为替代商品 从网络营销的特点来看 从店铺的角度出发 选择进价更低的手机可获得更多利润 11 替代商品的挖掘 天猫销售数据分析 我们以欧氏距离小于等于2为标准sqrt a price b price 2 a sales number b sales number 2 2将手机聚类 找出互为替代的手机 12 替代商品的挖掘 天猫销售数据分析 from future importdivisionfrommathimportsqrt coding gbkf1 open r e tmao shoujiinformation txt records f1 readlines f1 close price number product foriinrange len records item records i split t price append item 0 product append item 1 number append item 2 foriinrange len price forjinrange i 1 len price distance sqrt pow float price i float price j 2 pow int number i int number j 2 ifdistance 2 ifthedistanceminuse2 weconsiderthetwoisreplacedproductprintproduct i t product j else pass 13 所得结果 结果发现 下列每一组中的手机互为替代商品 a umo 优摩w9220yusun 语信t28 b huawei 华为c8812zte 中兴n807 c oppou705ttcly910t d coolpad 酷派8150dzte 中兴v889d e k touch 天语e800umo 优摩w800七喜td710 f umo 优摩w800七喜td710konka 康佳e5680 g uniscope 优思u1201huawei 华为y300 0000 h coolpad 酷派8050coolpad 酷派e239 i motorola 摩托罗拉xt800索爱正品sa i960安卓4 0 j coolpad 酷派8020haier 海尔ht i600 k 七喜h750gionee 金立c620 l lenovo 联想a790e广信ef58 m huawei 华为c8810samsung 三星s6108 n aux 奥克斯v930tcly710 o philips 飞利浦w8355onn 欧恩v816g版 p tcly710gionee 金立gn705w 天猫销售数据分析 14 天猫销售数据分析 价格空洞的发现 经过分析 我们发现 作为中高端机营销 可选择3500 4000的价格空洞 可在较小压力下打入市场 15 京东商城销售数据分析 牛仔裤销售数据分析 用户消费记录的分析 从生产厂家的角度来说 如果得到大量消费者的尺码大小及颜色偏好 则对生产和销售是非常有利的 因此 我们统计了京东女性牛仔裤的销售记录 从中得到各尺码和颜色在总的销售数据中的比例 从而指导生产 通过用户的消费记录 分析出用户的喜好品牌 从而当该品牌有新产品推出和促销活动时优先推荐给这些用户 16 牛仔裤销售数据分析 用户尺码大小颜色偏好 17 数据获取与预处理 以爬虫程序从京东商城获取牛仔裤销售记录 并过滤出每个用户所购买的颜色 尺码 18 数据获取与预处理 京东商城销售数据分析 coding gbkimportreimporturllibpage 16 16 16 16 16 16 16 16 15 15 15 15 15 15 15 14 14 14 14 14 13 13 13 13 13 13 12 12 12 12 12 12 12 12 12 12 page记录了每件商品的评论页面数目f1 open r c users yanzhiqiang desktop jdongniuzaikuadd txt goods存储商品评论地址goodslist f1 readlines f1 close s1 r e jdong niuzaikupinglunadd s3 txt foriinrange 0 len goodslist forjinrange 1 page i 1 content urllib urlopen goodslist i strip str j 0 html read printgoodslist i strip str j 0 html save s1 str i s3f2 open save a f2 write content f2 write goodslist i strip page str j downloaded n f2 write n f2 close s1 r e jdong niuzaikupinglunadd s3 txt 19 数据获取与分析 foriinrange 0 35 s s1 str i s3f open s lines forlineinf readlines lines line strip f close color r 颜 色 size r 尺 码 date r 购买日期 multicolor re findall color lines print file i has len multicolor colorrecords n multisize re findall size lines print file i has len multisize sizerecords n multidate re findall date lines print file i has len multidate daterecords n f1 open s1 str i color s3 w forcinmulticolor f1 write c f1 write n f1 close f2 open s1 str i size s3 w forsinmultisize f2 write s f2 write n f2 close f3 open s1 str i date s3 w fordinmultidate f3 write d f3 write n f3 close 京东商城销售数据分析 20 用户尺码大小与颜色偏好挖掘 coding gbkimportrename 白 黑 粉 枣红 酒红 大红 红 紫 绿 杏 黄 棕 宝蓝 彩蓝 海蓝 深蓝 浅蓝 灰蓝 中蓝 天蓝 墨兰 墨蓝 藏蓝 蓝 橙 灰 countcolor 0 iforiinrange len name f1 open r e jdong allniuzaikucolor txt color f1 readlines f1 close forjincolor forkinrange 0 len name ifre search name k j countcolor k countcolor k 1breakf2 open r e jdong colorsummary txt a d dict zip name countcolor forkeyind keys f2 write str key t str d key f2 write n f2 close daxiao str i foriinrange 10 36 countsize i 0foriinrange len daxiao f3 open r e jdong allniuzaikusize txt size f3 readlines f3 close 21 用户尺码大小与颜色偏好挖掘 forainsize forbinrange 0 len daxiao ifre search daxiao b a strip countsize b countsize b 1breakelifre search xs a strip countsize 14 countsize 14 1breakelifre search s a strip countsize 15 countsize 15 1breakelifre search m a strip countsize 16 countsize 16 1breakelifre search l a strip countsize 17 countsize 17 1breakelifre search xl a strip countsize 18 countsize 18 1breakelifre search xxl a strip countsize 19 countsize 19 1breakelifre search xxxl a strip countsize 20 countsize 20 1breakelse breakf4 open r e jdong sizesummary txt a d2 dict zip daxiao countsize forkeyind2 keys f4 write str key t str d2 key f4 write n f4 close 最后得到33 098条牛仔裤的颜色 尺码等销售信息 22 用户尺码大小与颜色偏好挖掘 23 用户消费记录的分析 数据的获取用户品牌偏好的分析 京东商城销售数据分析 24 数据的获取 利用爬虫程序 获取用户消费记录原始html代码 并过滤出记录数大于30的用户的消费消费记录 25 数据的获取 京东商城销售数据分析 from future importdivision coding gbkimportmathimporturllibimportres1 r e jdong user user firstpage s3 txt f open r e jdong user userpinglunshudayu30 txt a foriinrange 1000000 1008594 yuanshifile s1 str i s3f1 open yuanshifile lines forlineinf1 readlines lines line strip f1 close n r 评论数 d 条 commentnumber re findall n lines ifcommentnumber ifint commentnumber 0 29 f write id str i f write t f write commentnumber 0 f write n f flush else pass 26 数据的获取 else passprint user i gotit f close f1 open r e jdong user userpinglunshudayu30 txt user f1 readlines f1 close h1 r f2 close 京东商城销售数据分析 27 用户品牌喜好分析 京东商城销售数据分析 coding gbkimportreimportosf1 open r c users yanzhiqiang desktop brand txt brand f1 readlines f1 close d foriinbrand d i strip 0s1 r e jdong kehu custmer s2 brandstatistic txt f3 open s1 final s2 w savetherecordsforiteminos listdir r e jdong user 28 用户品牌喜好分析 foriteminos listdir r e jdong user ifitem endswith goods records txt s str item id re search d s group f2 open r e jdong user str item r lines forlineinf2 readlines lines line strip f2 close f3 write id t forkeyind keys d k
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025智能座舱人机交互体验升级与供应链重塑趋势分析报告
- 2025智能合约在法律服务领域的应用场景开发与合规审查
- 2025智能制造市场发展分析及前景趋势与投资策略研究报告
- 2025新能源汽车产业链市场格局分析及技术突破方向研究预测报告
- 2025文化创意产业发展分析及IP开发与社会资本参与路径研究报告
- 高空作业维修机器人行业产业发展现状及未来发展趋势分析研究
- 幼儿园媒体舆情突发事件应急处置工作预案
- 家具行业供应链信息面试试题及答案
- 家具行业电商运营师智能家居考试试题及答案
- 家具行业产品设计创新面试题目及答案
- 组织工作实务-形考任务三-国开-参考资料
- 保险政策与中国式减贫经验、困局与路径优化
- 宣传视频拍摄服务投标技术方案技术标
- 广东“百千万工程”应知应会知识题库(附答案)
- 五年级下册数学约分练习100题附答案
- 医学实验技能操作大赛初赛试题
- 职业暴露预防与处理的效果评估与绩效改进研究课件
- 教育心理学-资源管理策略
- 2024年新兴铸管股份有限公司招聘笔试参考题库含答案解析
- 家庭安全隐患排查手册
- b超室管理制度
评论
0/150
提交评论