python
文章平均质量分 70
CN_XHP_888
这个作者很懒,什么都没留下…
展开
-
matplotlib.legend
class matplotlib.legend原创 2023-05-22 23:24:12 · 102 阅读 · 2 评论 -
python os.walk()
os.walk()os.walk(top, topdown=Ture, onerror=None, followlinks=False)top – 根目录下的每一个文件夹(包含它自己), 产生3-元组 (dirpath, dirnames, filenames)【文件夹路径, 文件夹名字, 文件名】;topdown --可选,为True或者没有指定, 一个目录的的3-元组将比它的任何子文件夹的3-元组先产生 (目录自上而下)。如果topdown为 False, 一个目录的3-元组将比它的任何子文件原创 2022-04-12 00:10:50 · 1121 阅读 · 0 评论 -
matplotlib basic
matplotlib basic原创 2022-04-10 19:53:42 · 110 阅读 · 0 评论 -
python pip
查看pip相关信息:pip show pip升级pip:python -m pip install --upgrade pip设置pip源:pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/安装相关包pip install pandas numpy matplotlib seaborn xlsxwriter scikit-learn xlrd xlwt jupyter xgboost jupyter原创 2021-09-19 20:01:11 · 94 阅读 · 0 评论 -
Python re模块split方法: 多个字符分割字符串
Python re模块split方法: 多个字符分割字符串(普通split方法只能用一个字符分割字符串)import rea = "Hello world!How are you?My friend.Tom"print(re.split(" |!|\?|\.", a))输出:[‘Hello’, ‘world’, ‘How’, ‘are’, ‘you’, ‘My’, ‘friend’, ...原创 2019-07-26 19:13:04 · 2469 阅读 · 0 评论 -
Python必选参数,默认参数,可选参数,关键字参数实例说明
# 定义两个必选参数的函数def my_pow1(x, n): if not isinstance(x, (int, float)) or not isinstance(n, (int, float)): raise Exception("Input type error") result = 1 for i in range(n): re...原创 2019-08-18 13:16:27 · 1238 阅读 · 0 评论