数据特征分析-对比分析

对比分析是对两个互相联系的指标进行比较。

绝对数比较(相减):指标在量级上不能差别过大,常用折线图、柱状图

相对数比较(相除):结构分析、比例分析、空间比较分析、动态对比分析

 

df = pd.DataFrame(np.random.rand(30,2)*1000,columns=['A_sale','B_sale'],index = pd.date_range('2019/6/1','2019/6/30'))
df.style.format({'A':'{:.2f}','B':'{:.2f}'})

 

#
df.plot(figsize = (10,5),linestyle ='--',title ='A_sale to B_sale:line',marker = '.')
df.plot(kind = 'bar',figsize = (12,5),title = 'A_sale to B_sale:bar',width = 0.8,alpha = 0.8)

  

 

x = range(len(df))
y1 = df['A_sale']
y2 = -df['B_sale']fig,axes = plt.subplots(1,2,figsize = (15,5))
ax1 = axes[0]
ax1.bar(x,y1,facecolor = 'r')
ax1.bar(x,y2,facecolor = 'g')ax2 = axes[1]
y3 = df['A_sale'] - df['B_sale']
ax2.plot(x,y3)
plt.axhline(0,linestyle = '--',color = 'r')   #在y值为0处生成一条水平线
ax2.set_xticklabels(df.index[::4])

 

 

 

https://www.cnblogs.com/shengyang17/p/9630749.html

转载于:https://www.cnblogs.com/Forever77/p/11344408.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/391715.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Linux基线合规检查中各文件的作用及配置脚本

1./etc/motd 操作:echo " Authorized users only. All activity may be monitored and reported " > /etc/motd 效果:telnet和ssh登录后的输出信息 2. /etc/issue和/etc/issue.net 操作:echo " Authorized users only. All…

tableau使用_使用Tableau升级Kaplan-Meier曲线

tableau使用In a previous article, I showed how we can create the Kaplan-Meier curves using Python. As much as I love Python and writing code, there might be some alternative approaches with their unique set of benefits. Enter Tableau!在上一篇文章中 &#x…

踩坑 net core

webclient 可以替换为 HttpClient 下载获取url的内容: 证书: https://stackoverflow.com/questions/40014047/add-client-certificate-to-net-core-httpclient 转载于:https://www.cnblogs.com/zxs-onestar/p/7340386.html

我从参加#PerfMatters会议中学到的东西

by Stacey Tay通过史黛西泰 我从参加#PerfMatters会议中学到的东西 (What I learned from attending the #PerfMatters conference) 从前端的网络运行情况发布会上的注意事项 (Notes from a front-end web performance conference) This week I had the privilege of attendin…

修改innodb_flush_log_at_trx_commit参数提升insert性能

最近,在一个系统的慢查询日志里发现有个insert操作很慢,达到秒级,并且是比较简单的SQL语句,把语句拿出来到mysql中直接执行,速度却很快。 这种问题一般不是SQL语句本身的问题,而是在具体的应用环境中&#…

leetcode 1178. 猜字谜(位运算)

外国友人仿照中国字谜设计了一个英文版猜字谜小游戏,请你来猜猜看吧。 字谜的迷面 puzzle 按字符串形式给出,如果一个单词 word 符合下面两个条件,那么它就可以算作谜底: 单词 word 中包含谜面 puzzle 的第一个字母。 单词 word…

Nexus3.x.x上传第三方jar

exus3.x.x上传第三方jar: 1. create repository 选择maven2(hosted),说明: proxy:即你可以设置代理,设置了代理之后,在你的nexus中找不到的依赖就会去配置的代理的地址中找hosted:你可以上传你自…

责备的近义词_考试结果危机:我们应该责备算法吗?

责备的近义词I’ve been considering writing on the topic of algorithms for a little while, but with the Exam Results Fiasco dominating the headline news in the UK during the past week, I felt that now is the time to look more closely into the subject.我一直…

电脑如何设置终端设置代理_如何设置一个严肃的Kubernetes终端

电脑如何设置终端设置代理by Chris Cooney克里斯库尼(Chris Cooney) 如何设置一个严肃的Kubernetes终端 (How to set up a serious Kubernetes terminal) 所有k8s书呆子需要的CLI工具 (All the CLI tools a growing k8s nerd needs) Kubernetes comes pre-packaged with an ou…

spring cloud(二)

1. Feign应用 Feign的作用&#xff1b;使用Feign实现consumer-demo代码中调用服务 导入启动器依赖&#xff1b;开启Feign功能&#xff1b;编写Feign客户端&#xff1b;编写一个处理器ConsumerFeignController&#xff0c;注入Feign客户端并使用&#xff1b;测试 <dependen…

c/c++编译器的安装

MinGW(Minimalist GNU For Windows)是个精简的Windows平台C/C、ADA及Fortran编译器&#xff0c;相比Cygwin而言&#xff0c;体积要小很多&#xff0c;使用较为方便。 MinGW最大的特点就是编译出来的可执行文件能够独立在Windows上运行。 MinGW的组成&#xff1a; 编译器(支持C、…

渗透工具

渗透工具 https://blog.csdn.net/Fly_hps/article/details/89306104 查询工具 https://blog.csdn.net/Fly_hps/article/details/89070552 转载于:https://www.cnblogs.com/liuYGoo/p/11347693.html

numpy 线性代数_数据科学家的线性代数—用NumPy解释

numpy 线性代数Machine learning and deep learning models are data-hungry. The performance of them is highly dependent on the amount of data. Thus, we tend to collect as much data as possible in order to build a robust and accurate model. Data is collected i…

spring 注解方式配置Bean

概要&#xff1a; 再classpath中扫描组件 组件扫描&#xff08;component scanning&#xff09;&#xff1a;Spring可以从classpath下自己主动扫描。侦測和实例化具有特定注解的组件特定组件包含&#xff1a; Component&#xff1a;基本注解。标示了一个受Spring管理的组件&…

主成分分析 独立成分分析_主成分分析概述

主成分分析 独立成分分析by Moshe Binieli由Moshe Binieli 主成分分析概述 (An overview of Principal Component Analysis) This article will explain you what Principal Component Analysis (PCA) is, why we need it and how we use it. I will try to make it as simple…

扩展方法略好于帮助方法

如果针对一个类型实例的代码片段经常被用到&#xff0c;我们可能会想到把之封装成帮助方法。如下是一段针对DateTime类型实例的一段代码&#xff1a;class Program{static void Main(string[] args){DateTime d new DateTime(2001,5,18);switch (d.DayOfWeek){case DayOfWeek.…

零元学Expression Blend 4 - Chapter 25 以Text相关功能就能简单做出具有设计感的登入画面...

原文:零元学Expression Blend 4 - Chapter 25 以Text相关功能就能简单做出具有设计感的登入画面本章将交大家如何运用Blend 4 内的Text相关功能做出有设计感的登入画面 让你五分钟就能快速做出一个登入画面 ? 本章将教大家如何运用Blend 4 内的Text相关功能做出有设计感的登入…

leetcode 395. 至少有 K 个重复字符的最长子串(滑动窗口)

给你一个字符串 s 和一个整数 k &#xff0c;请你找出 s 中的最长子串&#xff0c; 要求该子串中的每一字符出现次数都不少于 k 。返回这一子串的长度。 示例 1&#xff1a; 输入&#xff1a;s “aaabb”, k 3 输出&#xff1a;3 解释&#xff1a;最长子串为 “aaa” &…

冠状病毒时代的负责任数据可视化

First, a little bit about me: I’m a data science grad student. I have been writing for Medium for a little while now. I’m a scorpio. I like long walks on beaches. And writing for Medium made me realize the importance of taking personal responsibility ove…

集合_java集合框架

转载自http://blog.csdn.net/zsw101259/article/details/7570033 Java集合框架图 简化图&#xff1a; Java平台提供了一个全新的集合框架。“集合框架”主要由一组用来操作对象的接口组成。不同接口描述一组不同数据类型。 1、Java 2集合框架图 ①集合接口&#xff1a;6个…