摘要: from sklearn.datasets import load_boston from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sk 阅读全文
posted @ 2025-11-18 14:27 三叶草╮ 阅读(9) 评论(0) 推荐(0)
摘要: from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from skle 阅读全文
posted @ 2025-11-06 13:44 三叶草╮ 阅读(15) 评论(0) 推荐(0)
摘要: 长期使用 Python 时,经常会面临多版本管理、依赖冲突以及库管理等问题,此时选择合适的包管理工具尤为重要。常见的工具包括 pipenv、virtualenv、Conda、Poetry、Rye、pipx、pip-sync 以及 uv。面对众多选择,应根据项目需求、环境隔离、依赖复杂度及团队协作等因 阅读全文
posted @ 2025-11-04 16:40 三叶草╮ 阅读(148) 评论(0) 推荐(0)
摘要: 机器学习获取数据集,训练模型,预测模型,评估模型 示例代码 from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from sklearn.neighbors impor 阅读全文
posted @ 2025-10-23 14:52 三叶草╮ 阅读(17) 评论(0) 推荐(0)
摘要: 1.线程 使用Threading模块中的Thread类来创建线程,如需传递执行的函数的参数,通过Thread的args参数传递即可. import threading import time def worker(): print(f"Thread {threading.current_thread 阅读全文
posted @ 2025-09-29 09:47 三叶草╮ 阅读(25) 评论(0) 推荐(0)
摘要: 01.Python 装饰器 方式1:使用函数的方式给函数定义装饰器 from functools import wraps #无参数装饰器示例代码 def simple_decorator(func): @wraps(func) # 使用了@wraps(func)来装饰wrapper函数,这样可保留 阅读全文
posted @ 2025-03-27 17:10 三叶草╮ 阅读(38) 评论(0) 推荐(0)
摘要: 1.String 01.在Python中,字符串前加上r(即原始字符串字面量)的作用是告诉解释器,字符串中的反斜杠\应该被视为普通字符,而不是转义字符。这意味着字符串中的所有反斜杠都会被保留,不会被解释为转义字符。 # 普通字符串 path = "C:\\Users\\Username\\Docum 阅读全文
posted @ 2025-03-10 18:12 三叶草╮ 阅读(42) 评论(0) 推荐(0)
摘要: 处理示例: 清洗成 -> Code: import pandas as pd # 读取Excel,跳过前面两行空行 studf = pd.read_excel(r'student_excel.xlsx', skiprows=2) print(studf) # 删除掉全部是空值的列 studf.dro 阅读全文
posted @ 2025-03-04 15:26 三叶草╮ 阅读(42) 评论(0) 推荐(0)
摘要: 1.官网 https://pandas.pydata.org/docs/user_guide/10min.html 01.读写Excel: import pandas as pd # 读取Excel帮助Link :https://pandas.pydata.org/docs/user_guide/i 阅读全文
posted @ 2025-02-17 16:11 三叶草╮ 阅读(37) 评论(0) 推荐(0)
摘要: 1.官网 https://playwright.nodejs.cn/docs/api/class-playwright 2.Playwright for Python:https://playwright.bootcss.com/python/docs/intro 3.入门笔记:https://ww 阅读全文
posted @ 2024-12-12 16:06 三叶草╮ 阅读(90) 评论(0) 推荐(0)