上一页 1 ··· 60 61 62 63 64 65 66 67 68 ··· 100 下一页
摘要: 一、取行 1、单行 数组[index, :] # 取第index+1行 例子 import numpy as np arr1 = np.arange(0, 24).reshape(4, 6) # 取第2行数据 row1 = arr1[1, :] print(row1) 2、连续的多行 数组[star 阅读全文
posted @ 2019-11-28 23:29 市丸银 阅读(170) 评论(0) 推荐(0)
摘要: 一、CSV文件 CSV: Comma-Separated Value,逗号分隔值文件 显示:表格状态 源文件:换行和逗号分隔,逗号 列,换行 行 二、读取数据 1、方法 loadtxt(fname, dtype=float, delimiter=None, skiprows=0, usecols=N 阅读全文
posted @ 2019-11-28 23:27 市丸银 阅读(776) 评论(0) 推荐(0)
摘要: 一、数组和数的计算 数组和数计算,数组中的每个元素和数进行计算 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 市丸银 阅读(562) 评论(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 市丸银 阅读(221) 评论(0) 推荐(0)
摘要: 一、特点 数据必须是原始数据不能经过处理,数据连续型,显示一组或多组分布数据 histogram 直方图 normed 定额 二、核心 hist(x, bins=None, normed=None) # x是需要统计的数据,类型:数组 # bins是组数, 组数 = (max(数组)- min(数组 阅读全文
posted @ 2019-11-27 23:35 市丸银 阅读(393) 评论(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 市丸银 阅读(262) 评论(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 市丸银 阅读(226) 评论(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 市丸银 阅读(233) 评论(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 市丸银 阅读(211) 评论(0) 推荐(0)
摘要: 一、安装 conda install pymongo 二、使用 1、连接 from pymongo import MongoClient client = MongoClient(host='ip', port=27017) # 使用方括号的方式选择数据库和集合 collection = clien 阅读全文
posted @ 2019-11-26 18:01 市丸银 阅读(260) 评论(0) 推荐(0)
上一页 1 ··· 60 61 62 63 64 65 66 67 68 ··· 100 下一页