源:DataCamp 气泡的大小表示人口的多少,横坐标表示人均GDP(美元),纵坐标表示预期寿命.-- 作者:Hans Rosling Python 中有许许多多用于可视化的包,而 matplotlib 是它们的源头. 我们需要用到的是它的子包 pyplot ,通常它被简写成 plt 导入 1.Line plot # Print the last item from year and pop print(year[-1]) print(pop[-1]) # Import matplotlib.p…
今日内容 三元运算 函数 内容详细 三元运算(三目运算) v = 前面 if 条件 else 后面 if 条件: v = '前面' else: v = '后面' # 让用户输入值,如果值是整数,则转换成整数,否则赋值为None data = input('>>>') value = int(data) if data.isdecimal() else None 注意:先做出来,再思考如何简化. 函数 截至目前:面向过程编程. [可读性差/可重用性差]. # 面向过程编程 user_inp…
机器学习实战(Machine Learning in Action)学习笔记————09.利用PCA简化数据 关键字:PCA.主成分分析.降维作者:米仓山下时间:2018-11-15机器学习实战(Machine Learning in Action,@author: Peter Harrington)源码下载地址:https://www.manning.com/books/machine-learning-in-actiongit@github.com:pbharrin/machinelearn…