摘要: 我们经常听见的机器学习,深度学习,人工智能是其实一个包含关系:人工智能 >机器学习 >深度学习 人工智能:20世纪50年代提出到现在迅速发展,主要是计算机想人类一样思考与学习。机器学习:是人工智能的分支,通过算法使用大量的数据进行训练,达到额定的训练后完成训练生产模型,我们使用心得数据通过生产的模型 阅读全文
posted @ 2019-09-12 02:28 Jumpkin1122 阅读(397) 评论(0) 推荐(0)
摘要: """ 保存视频 保存视频接口:<VideoWriter object> = cv.VideoWriter( filename, fourcc, fps, frameSize[, isColor] ) 参数说明: filename:要保存的视频名称和路径(data/outVideo.mp4) fourcc:视频编码器 fps:帧率 framesize:帧数大小 isColor:True彩色,Fal 阅读全文
posted @ 2019-09-12 02:18 Jumpkin1122 阅读(3576) 评论(0) 推荐(0)
摘要: import cv2 cap = cv2.VideoCapture('data/zuqiu.mp4') while cap.isOpened(): ret, frame = cap.read() # 显示文字:图片,文字,位置,字体类型,字体大小,字体颜色,字体粗细 cv2.putText(frame, "foot ball", (10, 30), cv2.FONT_... 阅读全文
posted @ 2019-09-12 02:16 Jumpkin1122 阅读(1170) 评论(0) 推荐(0)
摘要: import cv2 cap = cv2.VideoCapture('data/1.mp4') while cap.isOpened(): ret, frame = cap.read() # 调整窗口大小 cv2.namedWindow("frame", 0) # 0可调大小,注意:窗口名必须imshow里面的一窗口名一直 cv2.resizeWindow(... 阅读全文
posted @ 2019-09-12 02:15 Jumpkin1122 阅读(8388) 评论(0) 推荐(1)
摘要: import cv2 from PIL import Image, ImageDraw, ImageFont import numpy as np cap = cv2.VideoCapture('data/1.mp4') while cap.isOpened(): ret, frame = cap.read() # 显示中文字体并画框 image = Image.fromarray(frame) 阅读全文
posted @ 2019-09-12 02:14 Jumpkin1122 阅读(1395) 评论(0) 推荐(0)
摘要: # OpenCV版本的视频检测 import cv2 # 图片识别方法封装 def discern(img): gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) cap = cv2.CascadeClassifier( "C:\Python36\Lib\site-packages\opencv-master\data... 阅读全文
posted @ 2019-09-12 02:13 Jumpkin1122 阅读(919) 评论(0) 推荐(0)
摘要: import cv2 filepath = "xxxx" img = cv2.imread(filepath) # 读取图片 gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # 转换灰色 # OpenCV人脸识别分类器 classifier = cv2.CascadeClassifier( "C:\Python36\Lib\site-... 阅读全文
posted @ 2019-09-12 02:12 Jumpkin1122 阅读(927) 评论(0) 推荐(0)
摘要: import cv2 videoFile = 'data/最强大脑.mp4' cap = cv2.VideoCapture(videoFile) frameNum = 0 while (cap.isOpened()): ret, frame = cap.read() frameNum = frameNum + 1 if frameNum % 2 == 0: # 调整... 阅读全文
posted @ 2019-09-12 02:11 Jumpkin1122 阅读(3142) 评论(0) 推荐(1)
摘要: 阅读全文
posted @ 2019-09-12 02:10 Jumpkin1122 阅读(1552) 评论(0) 推荐(0)
摘要: import pandas as pd df = pd.DataFrame({"month": [1, 4, 7, 10], "year": [2012, 2014, 2013, 2014], "sale": [55, 40, 84, 31]}) new_df = df.set_index(["year", "month"]) print(new_df.index.names) print(new 阅读全文
posted @ 2019-09-12 02:04 Jumpkin1122 阅读(955) 评论(0) 推荐(0)
摘要: 运行结果: 阅读全文
posted @ 2019-09-12 02:03 Jumpkin1122 阅读(866) 评论(0) 推荐(0)
摘要: 存储文件内容 阅读全文
posted @ 2019-09-12 02:02 Jumpkin1122 阅读(264) 评论(0) 推荐(0)
摘要: import pandas as pd import numpy as np data = pd.read_csv("./data/test.csv") print(data) print(pd.isnull(data)) # 缺失值True,其他False print(np.any(pd.isnull(data))) # 有缺失值True,没有False print(np.... 阅读全文
posted @ 2019-09-12 02:01 Jumpkin1122 阅读(200) 评论(0) 推荐(0)
摘要: import pandas as pd data = pd.Series([176, 174, 160, 180, 159, 163, 192, 184], index=["No1:176", "No2:174", "No3:160", "No4:180", "No5:159", "No6:163", "No7:192", "No8:184"]) print... 阅读全文
posted @ 2019-09-12 02:00 Jumpkin1122 阅读(862) 评论(0) 推荐(0)
摘要: 运行结果: 阅读全文
posted @ 2019-09-12 01:59 Jumpkin1122 阅读(631) 评论(0) 推荐(0)
摘要: import pandas as pd data = pd.DataFrame([[1, 2], [1, 2], [3, 2], [1, 3], [1, 2]]) # 去重 data_new = data.drop_duplicates() print(data_new) 0 1 0 1 2 2 3 2 3 1 3 阅读全文
posted @ 2019-09-12 01:57 Jumpkin1122 阅读(251) 评论(0) 推荐(0)
摘要: import pandas as pd import numpy as np # 生成需要字段的数据 data = np.random.normal(0, 1, (100, 30)) row = ["第{}列".format(i) for i in range(30)] col = ["第{}行".format(i) for i in range(100)] # 生成Dataframe数据 df 阅读全文
posted @ 2019-09-12 01:56 Jumpkin1122 阅读(7370) 评论(0) 推荐(1)
摘要: import pandas as pd # 显示所有列,行 # pd.set_option('display.max_columns', None) # pd.set_option('display.max_rows', None) # pd.set_option('max_colwidth',100) # 读取文件 df = pd.read_csv("z:/clear1.csv", encodi 阅读全文
posted @ 2019-09-12 01:55 Jumpkin1122 阅读(265) 评论(0) 推荐(0)
摘要: 运行结果: 阅读全文
posted @ 2019-09-12 01:54 Jumpkin1122 阅读(183) 评论(0) 推荐(0)
摘要: windows支持中文:安装中文字体 代码中配置--可以显示中文了 字体下载:https://pan.baidu.com/s/13IXLXm1gE4UIRtG31pVM6w 提取码:u5cy 代码中加两个行就可以显示中文了,windows解决很简单。注意SimHei是安装的字体,如果安装其他字体可以 阅读全文
posted @ 2019-09-12 01:50 Jumpkin1122 阅读(893) 评论(0) 推荐(0)
摘要: """ 直线图 颜色:b-蓝色,g-绿色,r-红色,c-蓝绿色,y-黄色,k-黑色,w-白色 形状:o-圆形,*-*,+-+,x-x 线条:- 实现,-- 虚线, -. 点实现, : 点线 """ import matplotlib.pyplot as plt # 1.创建画布 plt.figure() # 2.绘画直线图 plt.plot([1, 2, ... 阅读全文
posted @ 2019-09-12 01:46 Jumpkin1122 阅读(411) 评论(0) 推荐(0)
摘要: """ 设置画布属性并保存图片 """ import matplotlib.pyplot as plt plt.figure(figsize=(10, 4), dpi=80) # 图片长宽和清晰度 plt.plot([1, 2, 3, 4, 5], [13, 14, 12, 16, 13], "b") plt.savefig("image01.png") # 保存图片 plt.show() 阅读全文
posted @ 2019-09-12 01:43 Jumpkin1122 阅读(6518) 评论(0) 推荐(0)
摘要: """ 添加网格与猫叔 """ import matplotlib.pyplot as plt plt.figure(figsize=(10, 4), dpi=80) # 图片长宽和清晰度 plt.plot([1, 2, 3, 4, 5], [13, 14, 12, 16, 13], "b") plt.grid(True, linestyle="--", alpha=0.5) # 网格 plt.t 阅读全文
posted @ 2019-09-12 01:42 Jumpkin1122 阅读(791) 评论(0) 推荐(0)
摘要: """ 城市温度变化(支持中文) """ import matplotlib.pyplot as plt import random # 1.准备数据 x = range(60) y_shanghai = [random.uniform(15, 18) for i in x] y_beijing = [random.uniform(1, 3) for i in x] # 2.创建画布 plt.fi 阅读全文
posted @ 2019-09-12 01:40 Jumpkin1122 阅读(267) 评论(0) 推荐(0)
摘要: import matplotlib.pyplot as plt import random # 1.准备数据 x = range(60) y_shanghai = [random.uniform(15, 18) for i in x] y_beijing = [random.uniform(1, 3) for i in x] # 2.创建画布 # plt.figure(figsize=(10, ... 阅读全文
posted @ 2019-09-12 01:39 Jumpkin1122 阅读(571) 评论(0) 推荐(0)
摘要: import numpy as np import matplotlib.pyplot as plt # 1.数据准备 x = np.random.randn(30) y = np.random.randn(30) # 2.创建画布 plt.figure(figsize=(10, 4), dpi=80) # 3.绘制图像 plt.scatter(x, y) # 4.显示图像 plt.show() 阅读全文
posted @ 2019-09-12 01:38 Jumpkin1122 阅读(141) 评论(0) 推荐(0)
摘要: import numpy as np import matplotlib.pyplot as plt # 1.准备数据 x = np.linspace(-1, 1, 1000) y = 2 * x * x # 2.创建画布 plt.figure(figsize=(10, 4), dpi=80) # 3.绘制图像 plt.plot(x, y) # 添加网络显示 plt.grid(linestyle= 阅读全文
posted @ 2019-09-12 01:38 Jumpkin1122 阅读(483) 评论(0) 推荐(0)
摘要: import matplotlib.pyplot as plt # 1.数据准备 # 房屋面积数据 movie_names = ["雷神3","正义联盟","A","B","C","D","E"] # 房屋价格数据 tickets = [73853, 57767,22354,15969,14839,8716,52222] # 2.创建画布 plt.figure(figsize=(10, 4), ... 阅读全文
posted @ 2019-09-12 01:36 Jumpkin1122 阅读(184) 评论(0) 推荐(0)
摘要: import matplotlib.pyplot as plt move_name = ["雷神3", "速度与激情4", "正义联盟", "蜘蛛侠", "闪电侠", "绿巨人", "阿凡达"] place_count = [13270, 9945, 7679, 6799, 6101, 4621, 20105] # 创建画布 plt.figure(figsize=(10, 8), dpi=80)... 阅读全文
posted @ 2019-09-12 01:35 Jumpkin1122 阅读(445) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-09-12 01:33 Jumpkin1122 阅读(166) 评论(0) 推荐(0)
摘要: """ 线性图 颜色:b-蓝色,g-绿色,r-红色,c-蓝绿色,y-黄色,k-黑色,w-白色 形状:o-圆形,*-*,+-+,x-x 线条:- 实现,-- 虚线, -. 点实现, : 点线""" import matplotlib.pyplot as pltimport numpy as np x 阅读全文
posted @ 2019-09-12 01:31 Jumpkin1122 阅读(358) 评论(0) 推荐(0)