摘要:
计算机网络常见面试题总结 https://github.com/huihut/interview#computer-network https://blog.csdn.net/qzcsu/article/details/72861891 1. OSI,TCP/IP,五层协议的体系结构 OSI分层(7 阅读全文
摘要:
B站账号:皮一下很开心的豆子 https://space.bilibili.com/152063970 阅读全文
摘要:
from dateutil import rrule from datetime import datetime import time #计算日期差 untilYear = 2018 untilMonth = 5 untilDay = 1 # 2018年第一天 firstDay = datetim 阅读全文
摘要:
1. 实例方法 1.1 __add__(self, n) # -*- coding: utf-8 -*- # 数组类,支持数组与数字之间的四则运算 # 数组之间的 加法运算,内积运算和大小比较 # 数组元素访问和修改 # 成员测试 class MyArray: __value = [] __size 阅读全文
摘要:
那个 \1 是引用第一个分组,这个例子里面就是输出连续的字母 第一个括号:匹配除换行符以外的任意字符。 后面的括号:匹配相同的字符,所以输出的元组有两个元素。 阅读全文
摘要:
阅读全文
摘要:
1. 内置函数 1.1 dir 1.2 help 2. math 阅读全文
摘要:
# -*- coding: utf-8 -*- from os.path import isdir, join from os import listdir AllLines = [] # 保存所有代码行 NotRepeatedLines = [] # 保存非重复的代码行 file_num = 0 阅读全文
摘要:
import difflib A = open('./file/file01.txt', 'r') B = open('./file/file02.txt', 'r') contextA = A.read() contextB = B.read() s = difflib.SequenceMatch 阅读全文
摘要:
seconds = 15743 m, s = divmod(seconds, 60) h, m = divmod(m, 60) print("{0}:{1:02d}:{2:02d}".format(h, m, s)) 4:22:23 阅读全文
摘要:
with open('./file/test.txt', 'wb+') as f: for i in nums: s = struct.pack('i', i) f.write(s) 读: nums = [] with open('./file/2010.txt', 'rb+') as f: for 阅读全文
摘要:
a = " a b c " a.replace(" ", "") Out[210]: 'abc' strip()方法,去除字符串开头或者结尾的空格 a = " a b c " a.strip() Out[212]: 'a b c' 阅读全文
摘要:
a = "i love love you you" from collections import Counter dict( Counter(list(a.split())) ) Out[103]: {'i': 1, 'love': 2, 'you': 2} 或者: s = '11AAAdfdfB 阅读全文
摘要:
s = 'i am very very like you and like you' dict( [(i, s.split().count(i)) for i in s.split()] ) Out[2]: {'i': 1, 'am': 1, 'very': 2, 'like': 2, 'you': 阅读全文
摘要:
1. 语言模型 2. RNN LSTM语言模型 (梯度权重) (1)one to one : 图像分类 (2)one to many:图片描述 (3)many to one:文本情感分析、分类 (4)many to many(N vs M):Seq2Seq(机器翻译) (5)many to many 阅读全文
摘要:
1. NLP主要范畴 2. NLP涉及知识 (计算最大概率的句子) 3. NLTK库(http://www.nltk.org/) 3. 语料及词性标注 4. 分词 5. TF-IDF(统计一篇文章出现频率最高的词) 阅读全文
摘要:
1. cut cut的工作就是“剪”,具体的说就是在文件中负责 剪贴数据 用的。 cut命令从文件的每一行剪贴字节、字符 和 字段,并将这些字节、字符和字段输出。 1.1 基本用法 cut [选项参数] filename 说明:默认分隔符是制表符 1.2 选项参数说明 1.3 案例 2. sed 简 阅读全文
摘要:
sudo groupadd docker sudo usermod -aG docker $USER 切换到新组 newgrp - docker 重启 sudo service docker restart over 阅读全文
摘要:
(1)修改 sudo vim /etc/docker/daemon.json (2)添加 { "registry-mirrors": ["https://alzgoonw.mirror.aliyuncs.com"] } 并保存 (3)重启 systemctl restart docker sudo 阅读全文
摘要:
1. 爬虫常见的反爬策略和反爬攻克手段 阅读全文
摘要:
1. 前程无忧招聘信息爬虫 爬取这个网站: http://www.51job.com (设置选项后)分析链接得:https://search.51job.com/jobsearch/search_result.php # -*- coding: utf-8 -*- import requests i 阅读全文
摘要:
爬取这个网站:https://yq.aliyun.com/articles/ # -*- coding: utf-8 -*- import requests import re import time from parsel import Selector key = "Python" url = 阅读全文
摘要:
1. 基础 2. 实战 阅读全文
摘要:
1. 用Python批量爬取全站小说 爬取这个网站小说:http://www.shuquge.com/txt/89644/index.html 2. 爬取一本书 # -*- coding: utf-8 -*- """ Created on Sat Feb 8 20:31:43 2020 @autho 阅读全文
摘要:
1. 股票定向爬虫 2. 实例编写 2.1 建立工程和spider模板 (2)配置stocks.py文件 # -*- coding: utf-8 -*- import scrapy import re class StocksSpider(scrapy.Spider): name = 'stocks 阅读全文
摘要:
1. 第一个scrapy实例 1.1 建立一个Scrapy爬虫工程 scrapy startproject python123demo 1.2 在工程中产生一个scrapy爬虫 (1)生成一个demo的爬虫 scrapy genspider demo python123demo.io 1.3 配置产 阅读全文
摘要:
1. scrapy安装(https://www.osgeo.cn/scrapy/intro/install.html) 建议直接使用anaconda安装,方便快捷,pip安装会遇到很多问题!!!!http://www.scrapyd.cn/doc/124.html conda install -c 阅读全文
摘要:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --set show_channel_urls yes 显示全部镜像: conda config --s 阅读全文
摘要:
1. 股票数据定向爬虫 https://gupiao.baidu.com/stock http://quote.eastmoney.com/stock_list.html 2. 实例编写 2.1 获取HTML页面 def getHTMLText(url): try: r = requests.get 阅读全文