python 数据分析(大作业)
题 目 python 数据分析案例分析
姓 名 ***
学 号 ****
专业班级 ****
所在学院 ****
指导教师(职称) ***
二○** 年 * 月 ** 日
浙大城市学院《python 数据分析与应用》期末作业 摘要
I
python 数据分析案例分析
【摘要】 数据分析作为大数据技术的重要组成部分,近年来随着大数据技术逐渐
发展和成熟。数据分析技能,被认为是数据科学领域中数据从业人员需要具备的技
能之一。与此同时,数据分析师也成了时下最热门的职业之一。数据分析技能的掌
握是一个循序渐进的过程。明确数据分析概念、分析流程和分析方法等相关知识
是迈出数据分析的第一步。本文通过对 4 个案例进行分析来对数据分析有更深的
认识。
【关键词】 python,数据分析,案例分析
浙大城市学院《python 数据分析与应用》期末作业 Abstract
II
Python data analysis case studies
【Abstract】 As an important part of big data technology, data analysis
has gradually developed and matured with big data technology in recent
years.Data analysis skills are considered to be one of the skills required
for data practitioners in the field of data science.At the same time, data
analyst has become one of the hottest jobs of the day.Mastering data
analysis skills is a gradual process.The first step of data analysis is
to clarify the concepts, processes and methods of data analysis.In this
paper, through the analysis of 4 cases to have a deeper understanding of
data analysis.
【Key Words】 python,data analysis,case analysis
浙大城市学院《python 数据分析与应用》期末作业 目录
III
目录
第 1 章 绪论............................................................................................................................1
1.1 认识数据分析...........................................................................................................1
1.2 数据分析的概念.......................................................................................................1
1.3 数据分析的流程.......................................................................................................2
1.3.1 需求分析........................................................................................................2
1.3.2 数据获取........................................................................................................3
1.3.3 数据预处理....................................................................................................3
1.3.4 分析与建模....................................................................................................3
1.3.5 模型评价与优化............................................................................................4
1.3.6 部署................................................................................................................4
1.4 数据分析应用场景...................................................................................................4
1.4.1 客户分析( Customer Analytics) ....................................................................5
1.4.2 营销分析( Sales and Marketing Analytics) ...................................................5
1.4.3 社交媒体分析( Social Media Analytics)....................................................5
1.4.4 网络安全( Cyber Security) .........................................................................5
1.4.5 设备管理( Plant and Facility Management) ...............................................6
1.4.6 交通物流分析( Transport and Logistics Analytics) ...................................6
1.4.7 欺诈行为检测( Fraud Detection)................................................................6
第 2 章 药店销售数据分析....................................................................................................8
2.1 分析目的...................................................................................................................8
2.2 代码实现...................................................................................................................8
2.2.1 知识点............................................................................................................8
2.2.2 流程图..........................................................................................................10
2.2.3 导入原始数据..............................................................................................10
2.2.4 查看数据属性..............................................................................................11
2.2.5 数据清洗......................................................................................................12
2.2.6 构建模型......................................................................................................15
2.2.7 数据可视化..................................................................................................16
2.3 分析结果.................................................................................................................20
2.2.1 按天消费金额..............................................................................................20
2.2.2 按月消费金额..............................................................................................21
2.2.3 每天消费金额..............................................................................................21
2.4 心得体会.................................................................................................................22
第 3 章 股票数据分析..........................................................................................................23
浙大城市学院《python 数据分析与应用》期末作业 目录
IV
3.1 分析目的.................................................................................................................23
3.2 代码实现.................................................................................................................23
3.2.1 流程图..........................................................................................................23
3.2.2 准备数据......................................................................................................23
3.2.3 可视化数据、审查数据..............................................................................24
3.2.4 处理数据......................................................................................................26
3.2.5 根据 ACF、PACF 定阶 ..............................................................................27
3.2.6 拟合 ARIMA 模型.......................................................................................28
3.2.7 预测..............................................................................................................29
3.3 分析结果.................................................................................................................30
3.4 心得体会.................................................................................................................31
第 4 章 食品添加剂种类个数统计......................................................................................32
4.1 分析目的.................................................................................................................32
4.2 代码实现.................................................................................................................32
4.2.1 流程图..........................................................................................................32
4.2.2 准备工作......................................................................................................32
4.2.3 读取数据......................................................................................................33
4.2.4 数据处理......................................................................................................34
4.2.5 pandas 可视化 top10.....................................................................................35
4.3 分析结果.................................................................................................................36
4.4 心得体会.................................................................................................................36
第 5 章 用户消费行为分析..................................................................................................37
5.1 分析目的.................................................................................................................37
5.2 代码实现.................................................................................................................37
5.2.1 流程图..........................................................................................................37
5.2.2 数据清洗......................................................................................................37
5.2.3 按月分析数据趋势......................................................................................39
5.2.4 用户个体消费数据分析..............................................................................41
5.2.5 用户分层......................................................................................................44
5.3 分析结果.................................................................................................................50
5.4 心得体会.................................................................................................................50
结论........................................................................................................................................51
参考文献................................................................................................................................52