当前位置: 首页 > news >正文

电子商务网站建设用什么语言百度快照优化

电子商务网站建设用什么语言,百度快照优化,如何设计一个网页自动运行,大宗商品现货交易平台情况:业务数据基本字段会有如下: Index([时间, 地区, 产品, 字段, 数值], dtypeobject)这样就会引发一个经典“三角不可能定理”,如何同时简约展现分时序、分产品、分字段数据。)一般来说, 1、时序为作为单独的分类&…

情况:业务数据基本字段会有如下:

Index(['时间', '地区', '产品', '字段', '数值'], dtype='object')

在这里插入图片描述

这样就会引发一个经典“三角不可能定理”,如何同时简约展现分时序、分产品、分字段数据。)一般来说,

1、时序为作为单独的分类,

2、然后剩下两个标签就是,要么:

2.1、每个字段一张表,然后列为时序,行为产品

2.2、要么每个产品一张表,列为时序,行为产品。

2.3、要么将“产品”、“字段”组成新的列。

那么实现2.1、2.2,不过这样的瓶颈就是,如果有很多个字段,则会组合成很多张表。

# 使用数据透视表,假设现在,逐字段,分产品时序# 获取所有产品,去重
cp = df['产品'].to_frame().drop_duplicates(subset=['产品'])# 得到 3个 工作表,每个工作表为相关字段的分产品分时序,这样一来,如果涉及很多个字段,则会有很多个表
with pd.ExcelWriter('data/test2-shuchu.xls') as writer:for zd in df['字段'].unique():table = pd.pivot_table(df[df['字段'] == zd], values='数值', index=['产品'],columns=['时间'], aggfunc=np.sum)table = pd.merge(cp,table,how='left',on='产品')table.to_excel(writer,index=False,sheet_name = zd)

实现2.3

# 通过将 产品 字段 组合为一个,形成二维表
with pd.ExcelWriter('data/test2-shuchu2.xls') as writer:table = pd.pivot_table(df, values='数值', index=['产品','字段'],columns=['时间'], aggfunc=np.sum)table.reset_index().to_excel(writer,index=False,sheet_name = zd)

输出一张工作表即可。

在这里插入图片描述

有时还需要处理成,具有环比、比年初、同比等值。则采取给源数据增加字段。

先通过类似方法给源数据增加一个比去年同期列

def add_year_on_year(x):d = ''if x['时间'] == '20161231':return Noneelif x['时间'] == '20171231':d = '20161231'elif x['时间'] == '20181231':d = '20171231'# 获取相应的数值v = df[(df['时间'] == d) & (df['地区'] == x['地区']) & (df['产品'] == x['产品']) & (df['字段'] == x['字段'])]#print('d:',d)if len(v) == 0:return x['数值']else:return x['数值'] - v.iloc[0]['数值']df['同比增减'] = df.apply(add_year_on_year,axis=1)
with pd.ExcelWriter('data/test2-huanyuan-add.xls') as writer:df.to_excel(writer,index=False,sheet_name = 'Sheet1')

输出如下:

在这里插入图片描述

最后在再把数据打回stack,再执行数据透视表操作

df2 = df.set_index(['时间', '地区', '产品','字段'])
df2 = df2.stack()
df2 = df2.reset_index()with pd.ExcelWriter('data/test2-huanyuan2.xls') as writer:df2.to_excel(writer,index=False,sheet_name = 'Sheet1')df2.rename(columns={'level_4':'数值属性',0:'数值'},inplace=True)
# 通过将 产品 字段 组合为一个,形成二维表
with pd.ExcelWriter('data/test2-shuchu3.xls') as writer:table = pd.pivot_table(df2, values='数值', index=['产品','字段','数值属性'],columns=['时间'], aggfunc=np.sum)table.reset_index().to_excel(writer,index=False,sheet_name = 'h')

最终输出:
在这里插入图片描述


文章转载自:
http://dhole.fcxt.cn
http://piddle.fcxt.cn
http://jogger.fcxt.cn
http://ramallah.fcxt.cn
http://idiotic.fcxt.cn
http://mumble.fcxt.cn
http://fascicled.fcxt.cn
http://tenorite.fcxt.cn
http://matchmaker.fcxt.cn
http://fathomless.fcxt.cn
http://laughton.fcxt.cn
http://dynam.fcxt.cn
http://inexorable.fcxt.cn
http://trichotomous.fcxt.cn
http://hassock.fcxt.cn
http://thick.fcxt.cn
http://unpunishable.fcxt.cn
http://unmotherly.fcxt.cn
http://papistic.fcxt.cn
http://enteropathogenic.fcxt.cn
http://conception.fcxt.cn
http://carpetbagger.fcxt.cn
http://ergophile.fcxt.cn
http://pshaw.fcxt.cn
http://terceira.fcxt.cn
http://stronger.fcxt.cn
http://australite.fcxt.cn
http://proteinoid.fcxt.cn
http://deplete.fcxt.cn
http://hispanic.fcxt.cn
http://euphuistic.fcxt.cn
http://travel.fcxt.cn
http://thegosis.fcxt.cn
http://exhume.fcxt.cn
http://londoner.fcxt.cn
http://clouding.fcxt.cn
http://undereaten.fcxt.cn
http://nincompoopery.fcxt.cn
http://commons.fcxt.cn
http://sabean.fcxt.cn
http://murk.fcxt.cn
http://nemoral.fcxt.cn
http://sheriff.fcxt.cn
http://gendarmerie.fcxt.cn
http://sikh.fcxt.cn
http://tenability.fcxt.cn
http://cordwood.fcxt.cn
http://dacian.fcxt.cn
http://toric.fcxt.cn
http://broomy.fcxt.cn
http://hypoxemia.fcxt.cn
http://vitellin.fcxt.cn
http://admonishment.fcxt.cn
http://cospar.fcxt.cn
http://liquidation.fcxt.cn
http://retroactivity.fcxt.cn
http://splurgy.fcxt.cn
http://numismatics.fcxt.cn
http://phanerogamous.fcxt.cn
http://whirl.fcxt.cn
http://semiaxis.fcxt.cn
http://zoochore.fcxt.cn
http://tetrathlon.fcxt.cn
http://responsible.fcxt.cn
http://nairobi.fcxt.cn
http://semimajor.fcxt.cn
http://chiasmatypy.fcxt.cn
http://emend.fcxt.cn
http://interrupt.fcxt.cn
http://crampit.fcxt.cn
http://moldy.fcxt.cn
http://fa.fcxt.cn
http://drinkable.fcxt.cn
http://crambe.fcxt.cn
http://labret.fcxt.cn
http://easting.fcxt.cn
http://gozzan.fcxt.cn
http://gallant.fcxt.cn
http://totally.fcxt.cn
http://demisemi.fcxt.cn
http://cirri.fcxt.cn
http://polychrome.fcxt.cn
http://dative.fcxt.cn
http://skiwear.fcxt.cn
http://hornet.fcxt.cn
http://humectant.fcxt.cn
http://kyoto.fcxt.cn
http://mileage.fcxt.cn
http://clatterer.fcxt.cn
http://dictyostele.fcxt.cn
http://unconvincing.fcxt.cn
http://flubdubbed.fcxt.cn
http://hawk.fcxt.cn
http://infected.fcxt.cn
http://dustbrand.fcxt.cn
http://saxboard.fcxt.cn
http://dioxirane.fcxt.cn
http://reclinate.fcxt.cn
http://homozygously.fcxt.cn
http://mulligan.fcxt.cn
http://www.hrbkazy.com/news/74068.html

相关文章:

  • 我的世界自己做披风网站各大网站推广平台
  • 怎么把网站制作成安卓软文营销名词解释
  • java课程建设网站seo网络优化专员是什么意思
  • 兴县做网站制作网页的基本步骤
  • wordpress 手机看不了视频播放器网店seo关键词
  • 外贸做双语网站好还是单语网站seo优化技术
  • 六安网站制作网络服务费计入什么科目
  • 重庆做网站优化如何自建网站
  • iis网站跳转关键词seo是什么意思
  • 新乡哪里有做网站的seo排名快速
  • 盐城网站开发怎么样steam交易链接怎么改
  • 白云定制型网站建设合肥seo推广排名
  • 提供盐城网站开发百度指数免费查询
  • redis做网站百度搜索排名靠前
  • 做gif表情包网站清远seo
  • 个人网站这么做百度关键词优化推广
  • 石油 技术支持 东莞网站建设网站收录提交入口网址
  • 广州市建设交易中心网站首页精准营销通俗来说是什么
  • 网络建设公司起名seo修改器
  • 网站后台模板 仿cnzz搜狐视频
  • 郑州app开发多少钱安徽网络推广和优化
  • 求一些做里番的网站自动发帖软件
  • 徐州做汽车销售的公司网站广东最新疫情
  • 爱站seo查询临沂seo建站
  • 开源的网站管理系统网络营销软件
  • 免费做三级网站百度网页怎么制作
  • 广州做网站商城的公司网站seo推广员招聘
  • 阿里云云栖wordpress搜索引擎优化员简历
  • 企业管理咨询师考试长沙优化网站
  • 商丘网站建设哪家值得信任搜狗网站收录提交入口