摘要: 闭包函数: 什么是闭包函数: 闭指的是定义在一个函数内部 包指的是该函数包含对外部作用域(非全局作用域)名字的引用 装饰器 1.什么是装饰器 就目前来看:装饰器就是定义一个函数,只不过该函数的功能是用来为其它函数添加额外的功能的 其实:装饰器本身其实可以是任意可调用的对象, 被装饰的对象也可以是任意 阅读全文
posted @ 2018-06-11 19:12 luck_L 阅读(149) 评论(0) 推荐(0) 编辑
摘要: from numpy import * import matplotlib.pyplot as plt def loadDataSet(): data_mat = [] label_mat = [] fr = open('testSet.txt') for line in fr.readlines(): line_arr = line.stri... 阅读全文
posted @ 2018-06-11 18:44 luck_L 阅读(198) 评论(0) 推荐(0) 编辑
摘要: from numpy import * import re import operator import feedparser def loadDataSet(): posting_ist = [['my', 'dog', 'has', 'flea', 'problems', 'help', 'please'], ['maybe', 'not',... 阅读全文
posted @ 2018-06-11 18:43 luck_L 阅读(213) 评论(0) 推荐(0) 编辑