随笔分类 -  数据分析

摘要:一、数组和数的计算 数组和数计算,数组中的每个元素和数进行计算 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 市丸银 阅读(499) 评论(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 市丸银 阅读(199) 评论(0) 推荐(0)
摘要:一、特点 数据必须是原始数据不能经过处理,数据连续型,显示一组或多组分布数据 histogram 直方图 normed 定额 二、核心 hist(x, bins=None, normed=None) # x是需要统计的数据,类型:数组 # bins是组数, 组数 = (max(数组)- min(数组 阅读全文
posted @ 2019-11-27 23:35 市丸银 阅读(365) 评论(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 市丸银 阅读(245) 评论(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 市丸银 阅读(189) 评论(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 市丸银 阅读(188) 评论(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 市丸银 阅读(199) 评论(0) 推荐(0)
摘要:一、创建ndarrary 1、使用np.arrary()创建 1)、一维数组 import numpy as np np.array([1, 2, 3, 4]) 2)、二维数组 np.array([[1, 2, 3], [3, 8,0], [3, 2, 5]]) 注意: a、创建数组的时候,数据类型 阅读全文
posted @ 2019-10-31 23:47 市丸银 阅读(143) 评论(0) 推荐(0)
摘要:向下添加cell b 进入编辑模式 Enter 结束编辑模式 ESC 运行 Ctrl + Enter 查看用法 shit + tab tab两次用法详解 提示 tab 待序 阅读全文
posted @ 2019-10-31 22:46 市丸银 阅读(144) 评论(0) 推荐(0)
摘要:一、安装numpy 1、下载 https://pypi.org/project/numpy/#files 2、安装 3、校验 二、安装matplotlib 阅读全文
posted @ 2019-10-31 21:21 市丸银 阅读(153) 评论(0) 推荐(0)
摘要:1、安装Ipython 2、安装jupyter 3、运行jupyter 阅读全文
posted @ 2019-10-31 20:41 市丸银 阅读(138) 评论(0) 推荐(0)