商业数据分析第一次课学习笔记
1.Python包的导入
* 貌似 jupyter 有种方法可以不用导入 matplotlib.pyplot 就可以实现图形的展示,待研究

补充说明:
1.可以使用%matplotlib inline


2.stock.plt() 为 pandas 内置作图函数
2.读取本地数据库,解析index,并指定“Date”为本数据库的索引

3.查看数据,一共有4种方法:
stock -- 查看全量数据(当数据量过大时,中间会用“...”隐藏)
stock.head() -- 默认查看前5行数据,增加参数后可自定义查看行数
stock.tail() -- 默认查看逆序5行数据,增加参数后可自定义查看行数
stock.info() -- 以参数值方式查看数据库


4.计算基础统计值
通过 stock.describe()可以输出 计数、均值、标准差、最大/最小值、1/4、1/2、3/4位值

5.通过 matplotlib 绘图(pandas默认将索引作为 X 轴)
默认出全量数据 stock.plot() ,可通过定义Y轴 stock.plot(y = 'Open') 指定出图字段

6.索引和切片,三种方式:
(1)使用[]
stock["Close"] -- 读取全量 Close 列表
stock["Close"]['2017-06-01'] -- 读取指定索引 Close 列表

(2)使用 .loc[]
stock.loc['2017-06-01','Close'] -- 读取指定索引 Close 列表
stock.loc['2017-06-01':'2017-06-05','Close'] -- 读取指定索引区间 Close 列表

(3)使用 .iloc[]
stock.iloc[0,3] -- 读取第0行3列值
stock.iloc[0:2,0:3] -- -- 读取第0-2行0-3列值

(4)另一种通过命令方式读取全量数据方法

7.过滤



8.生成新列
