2.5 绘制饼状图................................................................................................................56
2.6 绘制直方图................................................................................................................58
2.7 绘制等高线图............................................................................................................60
2.8 绘制三维图................................................................................................................61
习题..................................................................................................................................63
第三章 Pandas 数据分析库..................................................................................................65
3.1 Pandas 开发环境搭建 ...............................................................................................65
3.1.1 Anaconda 下载和安装 ...................................................................................65
3.1.2 新建 Jupyter Notebook 文件.........................................................................71
3.1.3 运行第一段代码............................................................................................72
3.1.4 重命名 Jupyter Notebook 文件.....................................................................73
3.1.5 保存 Jupyter Notebook 文件.........................................................................73
3.2 Pandas 数据类型 .......................................................................................................74
3.2.1 Series 对象创建..............................................................................................74
3.2.2 DataFrame 对象创建......................................................................................77
3.2.3 获取 Series 对象的值....................................................................................80
3.2.4 获取 DataFrame 的值....................................................................................82
3.2.5 Series 的方法..................................................................................................87
3.2.6 Series 的条件过滤..........................................................................................89
3.2.7 DataFrame 的条件过滤..................................................................................90
3.3 处理缺失值...............................................................................................................91
3.3.1 缺失值查看.....................................................................................................91
3.3.2 缺失值删除.....................................................................................................93
3.3.3 缺失值填充.....................................................................................................95
3.4 拼接...........................................................................................................................98
3.5 merge 的使用...........................................................................................................101
习题................................................................................................................................106
第四章 Python 进行数据分析 ............................................................................................107
4.1 导入外部数据.........................................................................................................107
4.1.1 导入.xlsx 文件..............................................................................................107
4.1.2 导入.csv 文件 ..............................................................................................110
4.1.3 导入.txt 文件 ...............................................................................................113
4.2 查看数据.................................................................................................................114
4.2.1 预览前、后几行..........................................................................................114
4.2.2 调用 shape 获取数据表的大小 ...................................................................115