随笔分类 -  Python学习笔记和代码记录

摘要:通过pip安装certifi后,终端下pip和conda的各种命令都会报错,python控制台里import requests也会报错,报错信息: PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'C:\\Users\\Name\\AppDa 阅读全文
posted @ 2024-01-10 16:17 梁书源 阅读(41) 评论(0) 推荐(0)
摘要:# simstring(original) - package url: http://www.chokkan.org/software/simstring/ - author: chokkan - 完全由C++编写 # simstring-fast - package url: https://g 阅读全文
posted @ 2023-07-18 10:12 梁书源 阅读(62) 评论(0) 推荐(0)
摘要:# 函数 ## 调试相关 - F8 step over单步执行会把函数调用视作一行,直接执行,不会进入函数内部 - F7 step into也可以单步执行,如果是函数,会进入函数内部 - 函数注释使用三对引号 ## 参数相关 - 形参和实参:定义函数时使用的参数是形参,调用函数时传入的函数是实参 - 阅读全文
posted @ 2023-06-19 23:01 梁书源 阅读(30) 评论(0) 推荐(0)
摘要:Python对并发编程的支持 多线程:Threading,利用CPU和IO同时执行的原理,让CPU不会干巴巴的等待 多进程:Multiprocessing,利用多核CPU,每个CPU都进行计算和IO 异步IO:asyncio;单线程,实现函数异步执行 使用Lock对资源加锁 使用Queue实现不同线 阅读全文
posted @ 2023-06-02 16:03 梁书源 阅读(26) 评论(0) 推荐(0)
摘要:官方参考文档 https://www.stata.com/python/api17/index.html 不论是从Stata里调用python,还是从python里调用stata,都无法实现stata和python的数据互通。为了实现stata和Python的数据互通,stata官方提供了名为sfi 阅读全文
posted @ 2023-05-04 21:25 梁书源 阅读(777) 评论(0) 推荐(0)
摘要:原文:https://docs.python.org/3/tutorial/introduction.html 版本:3.11.2 Using Python as a Calculator Numbers Division (/) always returns a float. To do floo 阅读全文
posted @ 2023-03-29 22:17 梁书源 阅读(73) 评论(0) 推荐(0)
摘要:模糊合并中的笔记 process.extractOne( query="中国平安", choices=["中国 平安"], scorer=fuzz.token_set_ratio, score_cutoff=0) process.extractOne( query="中国 平安 人寿保险 股份 东莞 阅读全文
posted @ 2023-03-21 23:14 梁书源 阅读(34) 评论(0) 推荐(0)
摘要:# df.loc - Access a group of rows and columns by label(s) or a boolean array. 只能通过标签和布尔值来索取数据 - `df.loc[]` 与`df.iloc[[]]`的区别: `[]`返回一个Series,`[[]]`返回一 阅读全文
posted @ 2023-03-15 20:15 梁书源 阅读(32) 评论(0) 推荐(0)
摘要:# Levenshtein module ## distance(s1, s2, *, weights=(1, 1, 1), processor=None, score_cutoff=None) - 参数:s1和s2代表两个字符串,weights=(1,1,1)中的1分别代表对插入、删除和替换的权重 阅读全文
posted @ 2023-03-15 16:38 梁书源 阅读(303) 评论(0) 推荐(0)
摘要:# Pycharm设置Conda环境 https://www.jetbrains.com/help/pycharm/conda-support-creating-conda-virtual-environment.html # Excel表合并 ``` import pandas as pd imp 阅读全文
posted @ 2022-11-30 15:57 梁书源 阅读(58) 评论(0) 推荐(0)