随笔分类 -  AI / Python

摘要:安装 requests、beautifulsoup4 库 # 安装 requests、beautifulsoup4 库 pip install requests beautifulsoup4 -i https://pypi.tuna.tsinghua.edu.cn/simple 完成代码 # pip 阅读全文
posted @ 2024-08-02 09:36 VipSoft 阅读(26) 评论(0) 推荐(0) 编辑
摘要:Matplotlib.pyplot.plot 绘图 matplotlib.pyplot.scatter(x, y, s=None, c=None, marker=None, cmap=None, norm=None, vmin=None, vmax=None, alpha=None, linewid 阅读全文
posted @ 2024-01-24 10:08 VipSoft 阅读(154) 评论(0) 推荐(0) 编辑
摘要:模块 pickle 实现了对一个 Python 对象结构的二进制序列化和反序列化。 "pickling" 是将 Python 对象及其所拥有的层次结构转化为一个字节流的过程,而 "unpickling" 是相反的操作,会将(来自一个 binary file 或者 bytes-like object 阅读全文
posted @ 2024-01-17 08:55 VipSoft 阅读(321) 评论(5) 推荐(1) 编辑
摘要:tqdm官网地址:https://pypi.org/project/tqdm/ Github地址:https://github.com/tqdm/tqdm tqdm 是一个快速,可扩展的Python进度条,可以在 Python 长循环中添加一个进度提示信息,用户只需要封装任意的迭代器 tqdm(it 阅读全文
posted @ 2024-01-16 16:42 VipSoft 阅读(26) 评论(0) 推荐(0) 编辑
摘要:安装依赖 D:\OpenSource\Python>pip install pdf2image pillow -i https://pypi.tuna.tsinghua.edu.cn/simple from pdf2image import convert_from_path from PIL im 阅读全文
posted @ 2023-12-12 10:18 VipSoft 阅读(167) 评论(0) 推荐(0) 编辑
摘要:函数返回多个返回值 def multiple_return_value(): import datetime d = datetime.date.today() val_1 = '年份为:{}'.format(d.year) val_2 = '月份为:{}'.format(d.month) retu 阅读全文
posted @ 2023-11-24 16:34 VipSoft 阅读(13) 评论(0) 推荐(0) 编辑
摘要:读取 Excel 斜着读数据 import pandas as pd def read_sideling(direction, sheet_name, row_start, col_start, gap): """ 斜着读数据 :param sheet_name: :param direction: 阅读全文
posted @ 2023-10-17 09:04 VipSoft 阅读(28) 评论(0) 推荐(0) 编辑
摘要:间隔N行,读取某列数据 import pandas as pd def read_vertical(sheet_name, col_idx, gap): """ 竖着读数据, :param sheet_name: 第几个 sheet :param col_idx: 第几列,从 0 开始 :param 阅读全文
posted @ 2023-10-16 17:00 VipSoft 阅读(100) 评论(0) 推荐(0) 编辑
摘要:获取控制台输入参数 if __name__ == '__main__': while 1: question = input('用户:') answer = "你的问题是:" + question print('VipQA', answer) 阅读全文
posted @ 2023-10-09 14:00 VipSoft 阅读(19) 评论(0) 推荐(0) 编辑
摘要:Python 搭建 FastAPI 项目 要生成FastAPI项目的代码,你可以使用FastAPI的脚手架工具来快速创建一个基本的FastAPI应用程序。 以下是创建一个新的FastAPI项目的步骤: 安装FastAPI和cookiecutter。你可以使用pip来安装它们: pip install 阅读全文
posted @ 2023-09-18 08:17 VipSoft 阅读(84) 评论(0) 推荐(0) 编辑
摘要:### 前提条件 - 先往Neo4j 里,准备数据 参考:https://www.cnblogs.com/vipsoft/p/17631347.html#%E5%88%9B%E5%BB%BA%E4%BC%A0%E6%89%BF%E4%BA%BA - 搭建 FastAPI 项目:https://www 阅读全文
posted @ 2023-09-08 10:59 VipSoft 阅读(325) 评论(0) 推荐(0) 编辑
摘要:一般网上的文章都是以脚本的方式写Demor的,没找到自己想要的那种项目结构型的示例(类似Java SpringBoot 创建 Model,通过 pom 进行关联配置的那种) 看了一些源码,再结合自己的想法,建了一个简单的示例, 用 Python 做接口服务的项目搭建,仅供参考 代码结构说明 VipQ 阅读全文
posted @ 2023-09-08 08:16 VipSoft 阅读(1287) 评论(4) 推荐(2) 编辑
摘要:为了方便调试代码,经常会向stdout中输出一些日志,但是大量日志,有时不好定位问题。 使用终端打印特定颜色字符串,可以突出显示关键性的信息,帮助用户更好地识别和理解输出内容。 https://pypi.org/project/colorama/ Colorama 是为了在命令行界面中提供简单、方便 阅读全文
posted @ 2023-09-07 08:12 VipSoft 阅读(514) 评论(0) 推荐(0) 编辑
摘要:### Python中的os模块 Python中的os模块提供了很多与操作系统相关的功能。其中就包括设置环境变量的方法,即setenv()方法。 使用os.setenv()方法设置环境变量 ```python import os os.setenv('VAR_NAME', 'VAR_VALUE') 阅读全文
posted @ 2023-09-06 11:48 VipSoft 阅读(1613) 评论(0) 推荐(0) 编辑
摘要:目录JSON 转换为 CSVCSV 转 JSON行、列操作 CSV(Comma-Separated Values,逗号分隔值,有时也称为字符分隔值,因为分隔字符也可以不是逗号),其文件以纯文本形式存储表格数据(数字和文本)。 CSV 是一种通用的、相对简单的文件格式,被用户、商业和科学广泛应用。 A 阅读全文
posted @ 2023-08-29 09:31 VipSoft 阅读(801) 评论(0) 推荐(0) 编辑
摘要:[TOC] Pandas 可以很方便的处理 JSON 数据 demo.json ```json [ { "name":"张三", "age":23, "gender":true }, { "name":"李四", "age":24, "gender":true }, { "name":"王五", " 阅读全文
posted @ 2023-08-28 11:05 VipSoft 阅读(537) 评论(0) 推荐(1) 编辑
摘要:[TOC] Pandas 一个强大的分析结构化数据的工具集,基础是 Numpy(提供高性能的矩阵运算) Pandas 可以从各种文件格式比如 CSV、JSON、SQL、Microsoft Excel 导入数据。 Pandas 可以对各种数据进行运算操作,比如归并、再成形、选择,还有数据清洗和数据加工 阅读全文
posted @ 2023-08-25 15:24 VipSoft 阅读(353) 评论(0) 推荐(1) 编辑
摘要:Django、Flask和FastAPI是Python Web框架中的三个主要代表。这些框架都有着各自的优点和缺点,适合不同类型和规模的应用程序。 1. Django: Django是一个全功能的Web框架,它提供了很多内置的应用程序和工具,使得开发Web应用程序更加容易。Django采用了MTV( 阅读全文
posted @ 2023-08-24 17:40 VipSoft 阅读(1448) 评论(1) 推荐(1) 编辑
摘要:``` Initializing database.. Traceback (most recent call last): File "d:\program files\python38\lib\site-packages\django\db\backends\utils.py", line 82 阅读全文
posted @ 2023-07-20 16:45 VipSoft 阅读(518) 评论(0) 推荐(0) 编辑
摘要:Python 读取图片 转 base64 并生成 JSON ```python import json import base64 img_path = r'D:\OpenSource\PaddlePaddle\PaddleOCR\images\005.jpeg'; with open(img_pa 阅读全文
posted @ 2023-05-30 13:33 VipSoft 阅读(263) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示