上一页 1 2 3 4 5 6 ··· 14 下一页
摘要: 时间复杂度 ​ 用来估计算法运行时间的一个式子. ​ 一般来说, 时间复杂度高的算法比复杂度低的算法慢. 常见的时间复杂度: ​ O(1) < O(logn) < O(n) < O(nlogn) < O(n2) < O(n2logn) < O(n3) 快速判断时间复杂度 ​ 循环减半的过程 > O( 阅读全文
posted @ 2021-01-17 10:44 凯旋.Lau 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 导入模块和包 导入模块 import的过程中发生了哪些事情? 寻找模块 如果找到,开辟一块空间,执行这个模块 把这个模块中用到的名字都收录到开辟的空间中 创建一个变量来引用这个模块的空间 注意: 模块不会被重复导入 模块和文件之间的内存空间始终是隔离的 模块名字必须符合变量命名规范 模块之间不能循环 阅读全文
posted @ 2020-11-23 17:13 凯旋.Lau 阅读(84) 评论(0) 推荐(0) 编辑
摘要: logging模块的使用 简单配置 import logging # 简单配置 logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s: %(me 阅读全文
posted @ 2020-11-23 14:27 凯旋.Lau 阅读(66) 评论(0) 推荐(0) 编辑
摘要: """ Name: study_kmeans.py Author: KX-Lau Time: 2020/11/6 16:59 Desc: 实现kmeans聚类 """ import math import numpy as np import matplotlib.pyplot as plt fro 阅读全文
posted @ 2020-11-10 17:43 凯旋.Lau 阅读(229) 评论(0) 推荐(0) 编辑
摘要: import logging from gensim.models import word2vec import multiprocessing # 配置日志 logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s' 阅读全文
posted @ 2020-11-10 17:42 凯旋.Lau 阅读(333) 评论(0) 推荐(0) 编辑
摘要: import numpy as np import matplotlib.pyplot as plt x = np.linspace(-3, 3, 50) y = 2 * x + 1 plt.figure(figsize=(8, 5)) ax = plt.gca() ax.spines['right 阅读全文
posted @ 2020-11-07 16:43 凯旋.Lau 阅读(195) 评论(0) 推荐(0) 编辑
摘要: import numpy as np import matplotlib.pyplot as plt x = np.linspace(-3, 3, 50) y1 = 2 * x + 1 y2 = x * x plt.figure(num=3, figsize=(8, 5)) # 设置范围 plt.x 阅读全文
posted @ 2020-11-07 16:39 凯旋.Lau 阅读(127) 评论(0) 推荐(0) 编辑
摘要: import matplotlib.pyplot as plt import numpy as np # 一维数组, 元素为从-3到3之间均匀地产生50个点 x = np.linspace(-3, 3, 50) y1 = 2 * x + 1 y2 = x ** 2 # num=3表示图片上方标题, 阅读全文
posted @ 2020-11-07 16:37 凯旋.Lau 阅读(2186) 评论(0) 推荐(0) 编辑
摘要: windows下右键新建md文件 打开注册表 win键+R打开运行对话框, 输入regedit, 打开注册表编辑器. 修改注册表 在磁盘的任意位置新建一个文件, 后缀名为reg, 并写入一下内容 [HKEY_CLASSES_ROOT\.md] @="Typora.exe" [HKEY_CLASSES 阅读全文
posted @ 2020-10-14 13:10 凯旋.Lau 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 分布式 概念: 需要搭建一个分布式的机群, 然后在每一台电脑中执行同一组程序, 让其对某一网站的数据进行联合分布爬取. 原生的scrapy框架不能实现分布式的原因 调度器不能被共享, 管道也不能被共享. scrapy + scrapy-redis 可以实现分布式 scrapy-redis组件的作用: 阅读全文
posted @ 2020-09-25 11:23 凯旋.Lau 阅读(143) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 14 下一页