美文网首页
自行车业务分析 1.1

自行车业务分析 1.1

作者: 人间桑 | 来源:发表于2020-06-08 19:08 被阅读0次

一、自行车整体销售表现

1.1、从数据库读取源数据:dw_customer_order

作业 1.1.1、从Mysql读取dw_customer_order,形成DataFrame格式,赋予变量gather_customer_order,注意Mysql账号是有adventure_ods权限

#读取源数据。不同城市,每天产品销售信息

#创建数据库引擎

engine = create_engine("mysql://frogdata001:Frogdata!123@106.13.128.83:3306/adventure_ods?charset=utf8")

gather_customer_order=pd.read_sql_query('select * from dw_customer_order',con=engine)

#设定对应数据库的引擎,然后引用引擎

#查看源数据前5行,观察数据,判断数据是否正常识别

gather_customer_order.head()

作业 1.1.2、查看源数据类型:dw_customer_order

gather_customer_order.info()

作业 1.1.3、利用create_date字段增加create_year_month月份字段

#查看数据类型

gather_customer_order['create_date'][0]

#增加create_year_month月份字段。按月维度分析时使用

gather_customer_order['create_year_month']=gather_customer_order.create_date.apply(lambda x:x.strftime('%Y-%m'))

gather_customer_order['create_year_month'].head()

#注意strftime用法

#关于时间与字符串的相互转换:https://www.cnblogs.com/strivepy/p/10436213.html

https://www.csdn.net/gather_2c/MtjaMg5sNTM0LWJsb2cO0O0O.html

作业 1.1.4、筛选产品类型cplb_zw中的自行车作为新的gather_customer_order,目前存在如图情况,你需要剔除掉其余2个

#筛选产品类别为自行车的数据

gather_customer_order = gather_customer_order[gather_customer_order['cplb_zw']=='自行车']

gather_customer_order.head()

相关文章

  • 自行车业务分析 1.1

    一、自行车整体销售表现 1.1、从数据库读取源数据:dw_customer_order 作业 1.1.1、从Mys...

  • 自行车业务分析 1.1 总结

    1.python连接mysql的几种方式 https://blog.csdn.net/haoxun04/artic...

  • 人工智能复习1

    机器学习项目流程 1 定义问题 1.1 数据获取 1.2 业务需求分析 1 业务场景分析,了解业务背景知识2 讲业...

  • 数据分析思维读书笔记

    推荐书籍:《数据分析思维:分析方法和业务知识》 一、业务指标: 1.1 指标分类: 1.2 如何选择指标: · 北...

  • Dashboard可视化看板

    项目背景:本文是基于上篇文章的延伸Adventure Works数据库自行车业务分析 为满足业务自主分析的需求,考...

  • 数据产品记录

    3.31 数据产品经理的业务、数据、产品 业务洞察、数据分析、产品设计【迁移&链接】 1.1 数据需求的分层:业务...

  • 自行车业务分析 2.1

    二、2019年11月自行车地域销售表现 2.1、源数据dw_customer_order,数据清洗筛选10月11月...

  • 自行车业务分析 2.2

    2.2、2019年11月自行车区域销售量表现 作业 2.2.1 请按照'chinese_territory','c...

  • 自行车业务分析 复习

    总共载入三个表: gather_customer_order:创建日期,产品名,产品种类,订单数,客户数,总金额,...

  • 自行车业务分析 2.3

    2.3、2019年11月自行车销售量TOP10城市环比 作业 2.3.1、筛选11月自行车交易数据 赋予变量为ga...

网友评论

      本文标题:自行车业务分析 1.1

      本文链接:https://www.haomeiwen.com/subject/jihdtktx.html