数据分析08:matplotlib颜色与样式
import numpy as np
import matplotlib.pyplot as plt
'''
颜色:
- 八种内置默认颜色, 缩写
b :blue
g :green
r :red
c :cyan
m :magenta
y :yellow
k :black
w :white
- 其它颜色的表示方法
灰色阴影
html 十六进制
RGB 元组
'''
y = np.arange(1,5)
# 内置颜色表示
plt.plot(y,color ='g')
# 灰度表示方法
plt.plot(y+1,color = '0.5')
# html 十六进制
plt.plot(y+2,color = '#ff00ff')
# RGB ...
数据分析04:matplotlib柱形图
import numpy as np
import matplotlib.pyplot as plt
# 柱形图
# 例一
N =5
y = [15,28,10,30,25]
index = np.arange(N)
p = plt.bar(index,height=y)
plt.show()
# 例2
p1 = plt.bar(0,bottom=index,width=y,height=0.5,align='edge',color='red',orientation='horizontal')
plt.show()
p2 = plt.barh(index,width= y , align='edge',color ='green',height=0.5)
plt.show()
# 例3
sales_BJ = [52,55,63,53]
sales_SH = [44,66,55,41]
index = np.arange(4)
bar_width = 0.3
# 竖着显示
plt.bar(in ...
数据分析01:numpy基础
import numpy as np
# ndarray
'''
# 三种创建方式
1、从python的基础数据对象转化
2、通过numpy内置的函数生成
3、从硬盘(文件)读取数据
'''
# 创建方法一
a= [1,2,3,4]
x1 = np.array(a)
print(x1,"\n",type(x1))
# 创建方法二
x = np.arange(5)
print(x,"\n",type(x))
# # 创建方法三
# date,Open,low = np.loadtxt('..csv',delimiter="\t",skiprows=1,usecols=(1,2,4),unpack=True)
# print(date,"\n",Open,"\n",low)
# 常用函数
'''
min 最小值
max 最大值
...
数据分析02:matplotlib散点图
import numpy as np
import matplotlib.pyplot as plt
'''
散点图显示两组数据的值,每个点的坐标位置的值决定
用户观察两种变量的相关性:
正相关
负相关
不相关
'''
# 正相关
height = [161,170,174,165,182,175]
weight = [50,65,70,62,81,75]
plt.scatter(height,weight)
plt.show()
# 不相关
N = 1000
x = np.random.randn(N)
y = np.random.randn(N)
plt.scatter(x,y)
plt.show()
# 散点图的外观
'''
c 颜色
s 点(面积)大小
alpha 透明度
值的范围[0,1]
通过调节透明度,来观察点的集中性
m ...
数据分析03:matplotlib折线图
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
'''
折线图,用直线段将各数据连接起来组成的图形
常用来观察数据随时间变化的趋势
例如:股票价格,温度变化
'''
date ,open ,close = np.loadtxt("000001.csv",delimiter=',',converters={0:mdates.bytespdate2num('%Y-%m-%d')},skiprows=1,usecols=(0,1,3),unpack=True)
plt.plot_date(date,open,linestyle='--',color="green",marker="<")
plt.plot_date(date,open,linestyle= ...
CentOS-Maven配置
Centos-Maven配置
配置maven镜像
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
maven配置路径
export M2_HOME=/usr/local/maven3/apache-maven-3.6.3
export PATH=$PATH$:M2_HOME/bin
source /etc/profile
About ME
👋 读书城南,🤔
在未来面前,我们都是孩子~
📙
一个热衷于探索学习新方向、新事物的智能产品经理,闲暇时间喜欢coding💻、画图🎨、音乐🎵、学习ing~
👋 Social Media
🛠️ Blog: http://oce ...
SpringBoot-WebSocket聊天室
SpringBoot-WebSocket 聊天室
配置类Config
// websocket配置
@Bean
public ServerEndpointExporter serverEndpointExporter() {
return new ServerEndpointExporter();
}
业务类Controller
import org.springframework.stereotype.Component;
import javax.websocket.*;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArraySet;
/**
* * @Description: websocket的具体实现类
* * ...
SpringBoot启动自定义方法
SpringBoot启动自定义方法
一、实现CommandLineRunner接口,重写run方法
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import com.gzy.demo.NettyClient;
@Component
public class MyStart1 implements CommandLineRunner{
@Override
public void run(String... args) throws Exception {
NettyClient.connect(10007, "127.0.0.1");
}
}
二、实现ApplicationRunner接口,重写un方法
import org.springframework.boot.ApplicationArguments;
import org ...
SpringBoot数据访问JPA
SpringBoot数据访问-整合JPA
Entity --定义实体类,与数据表映射
Repository ---定义操作,操作实体类中的数据表
About ME
👋 读书城南,🤔
在未来面前,我们都是孩子~
📙
一个热衷于探索学习新方向、新事物的智能产品经理,闲暇时间喜欢coding💻、画图🎨、音乐🎵、学习ing~
👋 Social Media
🛠️ Blog: http://oceaneyes.top
⚡ PM导航: https://pmhub.oceangzy.top
☘️ CNBLOG: https://www.cnblogs.com/oceaneyes-gzy/
🌱 AI PRJ自己部署的一些算法demo: http://ai.oceangzy.top/
📫 Email: 1450136519@qq.com
💬 WeChat: OCEANGZY
💬 公众号: UncleJoker-GZY
👋 加入小组~
👋 感谢打赏~
CentOS7 防火墙控制与端口控制
firewalld
启动: systemctl start firewalld
关闭: systemctl stop firewalld
查看状态: systemctl status firewalld
开机禁用 : systemctl disable firewalld
开机启用 : systemctl enable firewalld
systemctl
systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。
启动一个服务:systemctl start firewalld.service
关闭一个服务:systemctl stop firewalld.service
重启一个服务:systemctl restart firewalld.service
显示一个服务的状态:systemctl status firewalld.service
在开机时启用一个服务:systemctl enable firewalld.service
在开机时禁用一个服务:systemctl disable firewalld.s ...