摘要: runoob re.sub例子 re.sub(pattern, repl, string, count=0, flags=0) re.sub('[^A-Za-z]+', ' ', line).strip().lower() 匹配多个连续的非字母,将它们替换为空格。 连续多个+ 非^ 单个[] 字母A 阅读全文
posted @ 2021-08-23 16:45 zae 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 加入f之后,可以直接在字符串中填入需要替换的字符: print('# text lines: {len(lines)}') print(f'# text lines: {len(lines)}') output: # text lines: {len(lines)} # text lines: 32 阅读全文
posted @ 2021-08-23 16:36 zae 阅读(638) 评论(0) 推荐(0) 编辑
摘要: delete from如何修改和删除同一个表中的字段 delete from history where ind in (select a.ind from (select ind from history where year=2021 and group_id=3 and month=7) as 阅读全文
posted @ 2021-08-21 12:12 zae 阅读(958) 评论(0) 推荐(0) 编辑
摘要: torch.nn.Flatten()可以是Sequential模型的一层,torch中定义的是: def __init__(self, start_dim: int = 1, end_dim: int = -1) -> None: super(Flatten, self).__init__() se 阅读全文
posted @ 2021-08-04 21:25 zae 阅读(528) 评论(0) 推荐(0) 编辑
摘要: alter table member auto_increment=460 创建mysql数据表,设置id列递增、主键 create table running_log ( id int primary key auto_increment, routename varchar(255), log 阅读全文
posted @ 2021-06-24 14:23 zae 阅读(70) 评论(0) 推荐(0) 编辑
摘要: itertools.chain(list_str,list_int) 你想在多个对象执行相同的操作,但是这些对象在不同的容器中,你希望代码在不失可读性的情况下避免写重复的循环. from itertools import chain a = [1, 2, 3, 4] b = [‘x’, ‘y’, ‘ 阅读全文
posted @ 2021-04-28 20:31 zae 阅读(45) 评论(0) 推荐(0) 编辑
摘要: neo4j简单查询 https://neo4j.com/docs/cypher-refcard/current/ 参考卡片 neo4j存储格式 where子句 match (p:FP{kprq:'王佳慧'}) return p limit 10 match(p:Person{name:"王涛"})- 阅读全文
posted @ 2021-03-16 17:27 zae 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 安装nodejs https://nodejs.org/en/ 下载安装好,程序自动配置了环境变量。(配置环境变量其实就是把可执行文件所在的目录添加到系统可查到的变量中) 使用vscode的terminal 安装live-server 配置好vscode,使其具备python环境。(terminal 阅读全文
posted @ 2021-03-12 21:24 zae 阅读(569) 评论(0) 推荐(0) 编辑
摘要: 数据创建 randint 创建随机整数array。 np.random.randint(10,size=(2,3)) randint(low, high=None, size=None, dtype='l') low为必选参数: 若有low与high,则返回两者之间的数据。[low, high)。 阅读全文
posted @ 2021-03-02 21:50 zae 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 认识defaultdict: 当我使用普通的字典时,用法一般是dict=,添加元素的只需要dict[element] =value即,调用的时候也是如此,dict[element] = xxx,但前提是element字典里,如果不在字典里就会报错. 这时defaultdict就能排上用场了,defa 阅读全文
posted @ 2021-03-02 16:35 zae 阅读(1446) 评论(0) 推荐(0) 编辑