上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 67 下一页
摘要: 一、数组和数的计算 数组和数计算,数组中的每个元素和数进行计算 1、加 import numpy as np arr1 = np.arange(12).reshape(3, 4) print(arr1) # 数组的每个元素和数进行加法运算 arr2 = arr1 + 2 print(arr2) 2、 阅读全文
posted @ 2019-11-28 23:25 市丸银 阅读(459) 评论(0) 推荐(0) 编辑
摘要: 一、基础知识 1、安装 conda install numpy 2、什么是numpy?Python中做科学计算的基础库,重在数值计算 二、创建数组 import numpy as np # 方式一 np.array([1, 2, 3, 4, 5]) # 方式二 np.array(range(5)) 阅读全文
posted @ 2019-11-28 18:03 市丸银 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 一、特点 数据必须是原始数据不能经过处理,数据连续型,显示一组或多组分布数据 histogram 直方图 normed 定额 二、核心 hist(x, bins=None, normed=None) # x是需要统计的数据,类型:数组 # bins是组数, 组数 = (max(数组)- min(数组 阅读全文
posted @ 2019-11-27 23:35 市丸银 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 一、特点 离散数据,数据之间没有直接的关系 二、分类 1、垂直条形图 bar(x, height, width=0.8) # x 为x轴 # height 为y轴 # width 为 条形图的宽度 例子 from matplotlib import pyplot as plt from matplo 阅读全文
posted @ 2019-11-27 23:32 市丸银 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 一、特点 离散的数据,查看分布规律,走向趋势 二、使用 1、核心 plt.scatter(x, y) # x为x轴的数据,可迭代对象,必须是数字 # y为y轴的数据,可迭代对象,必须是数字 # x和y必须一一对应 2、例子 注意:在设置x轴或y轴刻度时,ticks和labes的值要一一对应 from 阅读全文
posted @ 2019-11-27 22:49 市丸银 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 注意:绘图和设置x轴的刻度是相互独立的不相关的 官网:https://matplotlib.org/ 案例:https://matplotlib.org/3.1.1/gallery/index.html 一、安装 conda install matplotlib 二、作用 1.将数据可疏忽,更直观的 阅读全文
posted @ 2019-11-27 16:08 市丸银 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 1、基本要点 # 导入模块 from matplotlib import pyplot as plt # x轴数据 x = range(2, 26, 2) # y轴数据 y = [15, 13, 14.5, 17, 20, 25, 26, 26, 27, 22, 18, 15] # 绘图 plt.p 阅读全文
posted @ 2019-11-27 11:23 市丸银 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 一、安装 conda install pymongo 二、使用 1、连接 from pymongo import MongoClient client = MongoClient(host='ip', port=27017) # 使用方括号的方式选择数据库和集合 collection = clien 阅读全文
posted @ 2019-11-26 18:01 市丸银 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 一、作用 提升查找的速度 二、计算查找消耗时间 格式 db.集合名称.find(查询条件)..explain('executionStats') 例子 插入10万条数据到数据库中 for(i=0; i < 100000; i++){ db.t4.insert({name: 'test' + i, a 阅读全文
posted @ 2019-11-26 16:23 市丸银 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 这部分内容属于补充内容 1、xpath() 2、css() 3、正则表达式 # 多个值,列表 response.xpath('//a/text()').re('(.*?):\s(.*)') # 取第一个值 response.xpath('//a/text()').re_first('(.*?):\s 阅读全文
posted @ 2019-11-25 21:00 市丸银 阅读(112) 评论(0) 推荐(0) 编辑
上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 67 下一页