- 博客(5)
- 收藏
- 关注
原创 SQL统计城市商品销量&对应销量排名
-代替窗口函数不支持distinct的功能的,count(distinct(a.storecode)) over(partition by XXX))----and b.city in ('东莞市','广州市','深圳市')----distinct 去除重复数据----运用窗口函数排序、增加排名列----城市大类销量与排名。
2023-05-16 16:08:01
989
1
原创 用户分层(新、老用户,回头客用户等)
data['消费日期'] =pd.to_datetime(data['消费日期'],format='%Y%m%d')data['星期'] = data['消费日期'].apply(lambda x:x.weekday()+1)index = '会员ID',values= '订单ID',columns= '星期',一周内的消费状态有unreg,new,active,UNactive,return。数据报错,猜测可能存在问题的位置。
2023-05-16 15:41:35
161
1
原创 销售贡献占比分析(二八法则)
data1 = pd.read_excel('D:/Users/Administrator/Desktop/测试数据text/出货销售分析-门店1-2023_ 20230428.xlsx',usecols=['大区','事业部','服务课','开业时间','店号','本月'])data = pd.merge(data1,data2,on='店号').rename(columns = {'本月_x':'天数','本月_y':'日均销售'})#按月销字段进行升序排序。
2023-04-29 08:49:07
283
1
原创 物流数据分析
data_huo = data.groupby(['月份','区域'])['货品用户反馈'].value_counts().unstack()float(number[:number.find('万元')].replace(',','.'))*10000。#.unstack()不压缩行列。data1['按时交货率'] = data1['按时交货']/(data1['按时交货']+data1['晚交货'])float(number.replace('元','').replace(',',''))
2023-04-28 17:27:20
322
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人