Loading

摘要: 原因 环境变量中不包含当前路径 解决方法 解决方法有很多种,包括在环境变量文件夹添加pth文件,在导入模块前使用动态添加当前模块的路径到环境变量中。 这里介绍一种比较优雅的方案,修改VSCode配置文件 在设置中选择“工作区”,搜索terminal.integrated.env 在settings. 阅读全文
posted @ 2024-08-17 13:35 JinX-Digital 阅读(76) 评论(0) 推荐(0) 编辑
摘要: bbox_to_anchor参数 可以通过bbox_to_anchor参数将图例放置在坐标系外。bbox表示容纳图例的边界框-bounding box plt.legend(bbox_to_anchor=(x0, y0, width, height), loc=) width和 height是图例框 阅读全文
posted @ 2023-02-22 16:50 JinX-Digital 阅读(1521) 评论(0) 推荐(0) 编辑
摘要: 转载自:https://www.cnblogs.com/atanisi/p/8530693.html 1. 绘制双y轴:twinx(), 双x轴:twiny() # -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot a 阅读全文
posted @ 2023-02-22 16:11 JinX-Digital 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 由于直接使用reportlab绘制图表不是很方便,于是想到用matplotlib画图,将SVG嵌入PDF的方法。 需要用到svglib这个库,可以用pip install svglib安装 一个完整的例子: from io import BytesIO import matplotlib.pyplo 阅读全文
posted @ 2023-02-22 14:53 JinX-Digital 阅读(365) 评论(0) 推荐(0) 编辑
摘要: 1. 简介 Peewee 是一个 Python ORM(Object-Relational Mapping)库,支持 SQLite、MySQL、PostgreSQL 和 Cockroach 数据库。在 ORM 系统中,每个类都映射到底层数据库中的一个表。ORM可以处理这些问题,我们就不需要自己编写乏 阅读全文
posted @ 2022-12-20 13:40 JinX-Digital 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 服务器配置nfs文件共享 | 服务端 | 客户端 | | | | | 172.20.41.2 | 172.20.41.4/7 | ## NFS服务安装 通常情况下操作系统已经默认安装了nfs 可用一下命令确认是否安装: $ rpm -qa nfs-utils rpcbind nfs-utils-1. 阅读全文
posted @ 2022-08-10 12:20 JinX-Digital 阅读(384) 评论(0) 推荐(0) 编辑
摘要: 使用pandas将时间戳数字转为日期格式,发现和当前时间相差8小时,是时区不对导致的 下面提供两种解决方法: 使用tz_localize和tz_convert方法 import time import pandas as pd now_time = time.time() pd.Timestamp( 阅读全文
posted @ 2021-12-29 18:14 JinX-Digital 阅读(695) 评论(0) 推荐(0) 编辑
摘要: PostgreSQL SERIAL创建自增列 Navicat中新建ID自增列,类型选择series保存即可 PostgreSQL序列是一种特殊的用于生产整数序列数据库对象。序列通常用于主键列,与mysql的AUTO_INCREMENT 概念类似。创建表时使用serial伪类型定义序列: CREATE 阅读全文
posted @ 2021-12-16 17:25 JinX-Digital 阅读(1201) 评论(0) 推荐(0) 编辑
摘要: windows: pip install psycopg2 linux: pip install psycopg2-binary 阅读全文
posted @ 2021-11-23 16:46 JinX-Digital 阅读(889) 评论(0) 推荐(0) 编辑
摘要: from typing import Any, Callable, TypeVar import requests T = TypeVar("T") class MaxRetryError(Exception): def __init__(self): message = "超出最大重试次数" su 阅读全文
posted @ 2021-06-23 10:53 JinX-Digital 阅读(172) 评论(0) 推荐(0) 编辑